fork(1) 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. mondai1(102);
  26. printf("x = %d\n", x);
  27. mondai2();
  28. mondai2();
  29. mondai2();
  30. printf("x = %d\n", x);
  31. for (int i = 103; i<104; i++) {
  32. int x = i;
  33. printf("x = %d\n", x);
  34. x = mondai3(i);
  35. printf("x = %d\n", x);
  36. }
  37. printf("x = %d\n", x);
  38. return 0;
  39. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
x = 0
x = 101
x = 102
x = 12
x = 103
x = 104
x = 13