fork download
  1. #include <stdio.h>
  2.  
  3. int x;
  4.  
  5. void mondai1(int b){
  6. x = b;
  7. }
  8.  
  9. void mondai2(void){
  10. static int c = 10;
  11. x = c;
  12. c++;
  13. }
  14.  
  15. int mondai3(int d){
  16. x++;
  17. d++;
  18. return d;
  19. }
  20.  
  21. int main(void){
  22. printf("x=%d\n", x);
  23. x = 101;
  24. printf("x=%d\n", x);
  25.  
  26. mondai1(102);
  27. printf("x=%d\n", x);
  28.  
  29. mondai2();
  30. mondai2();
  31. mondai2();
  32. printf("x=%d\n", x);
  33.  
  34. for (int i = 103; i < 104; i++){
  35. int x = i;
  36. printf("x=%d\n", x);
  37. x = mondai3(i);
  38. printf("x=%d\n", x);
  39. }
  40.  
  41. printf("x=%d\n", x);
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
x=0
x=101
x=102
x=12
x=103
x=104
x=13