fork download
  1. #include <stdio.h>
  2. /*
  3. 2017年------------------
  4. 問題1
  5. a 5 5 5 5 6 5 6 5
  6. b 3 2 1 0 1 2 3
  7. c 32
  8. d 128
  9. e 5
  10. f 194
  11. 問題2
  12. int func(int x ,int y){
  13. if(x>=y){
  14. return x - y;
  15. }
  16. else{
  17. return y - x;
  18. }
  19. }
  20. 問題3
  21. a(再帰)
  22. int a(int n){
  23. if(n==0){
  24. return 0;
  25. }
  26. else{
  27. return 2 * a(n-1) + 3;
  28. }
  29. }
  30. b(再帰なし)
  31. int a(int n){
  32. if(n==0){
  33. return 0;
  34. }
  35. else{
  36. int i,m=0;
  37. for(i=1;i<=n,i++){
  38. m = 2 * m +3;
  39. }
  40. return m;
  41. }
  42. }
  43. 問題4
  44. a static int
  45. b primefactor(n/i);
  46. c exit(1);
  47. d primefactor(n);
  48.  
  49.  
  50. */
  51. int main(void) {
  52. // your code goes here
  53. return 0;
  54. }
  55.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty