fork download
  1. void main()
  2. { printf("Введите номер месяца:\n1-январь\n2-февраль\n3-март\n4-апрель\n5-май\n6-июнь\n7-июль\n8-август\n9-сентябрь\n10-октябрь\n11-ноябрь\n12-декабрь\n");
  3. scanf("%d", &n);
  4. switch(n) {
  5. case 1,2,12: printf("Зима"); break;
  6. case 3,4,5: printf("Весна"); break;
  7. case 6,7,8: printf("Лето"); break;
  8. case 9,10,11: printf("Осень"); break;
  9. default: printf("Нет такого месяца");}
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
compilation info
prog.c:1:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
 void main()
      ^~~~
prog.c: In function ‘main’:
prog.c:2:3: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
 { printf("Введите номер месяца:\n1-январь\n2-февраль\n3-март\n4-апрель\n5-май\n6-июнь\n7-июль\n8-август\n9-сентябрь\n10-октябрь\n11-ноябрь\n12-декабрь\n");
   ^~~~~~
prog.c:2:3: warning: incompatible implicit declaration of built-in function ‘printf’
prog.c:2:3: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+#include <stdio.h>
 void main()
 { printf("Введите номер месяца:\n1-январь\n2-февраль\n3-март\n4-апрель\n5-май\n6-июнь\n7-июль\n8-август\n9-сентябрь\n10-октябрь\n11-ноябрь\n12-декабрь\n");
   ^~~~~~
prog.c:3:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
 scanf("%d", &n);
 ^~~~~
prog.c:3:1: warning: incompatible implicit declaration of built-in function ‘scanf’
prog.c:3:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
prog.c:3:14: error: ‘n’ undeclared (first use in this function)
 scanf("%d", &n);
              ^
prog.c:3:14: note: each undeclared identifier is reported only once for each function it appears in
prog.c:5:7: error: expected ‘:’ or ‘...’ before ‘,’ token
 case 1,2,12: printf("Зима"); break;
       ^
prog.c:5:7: error: expected expression before ‘,’ token
prog.c:5:7: warning: left-hand operand of comma expression has no effect [-Wunused-value]
prog.c:5:9: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 case 1,2,12: printf("Зима"); break;
         ^
prog.c:5:9: warning: statement with no effect [-Wunused-value]
prog.c:6:7: error: expected ‘:’ or ‘...’ before ‘,’ token
 case 3,4,5: printf("Весна"); break;
       ^
prog.c:6:7: error: expected expression before ‘,’ token
prog.c:6:7: warning: left-hand operand of comma expression has no effect [-Wunused-value]
prog.c:6:9: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 case 3,4,5: printf("Весна"); break;
         ^
prog.c:6:9: warning: statement with no effect [-Wunused-value]
prog.c:7:7: error: expected ‘:’ or ‘...’ before ‘,’ token
 case 6,7,8: printf("Лето"); break;
       ^
prog.c:7:7: error: expected expression before ‘,’ token
prog.c:7:7: warning: left-hand operand of comma expression has no effect [-Wunused-value]
prog.c:7:9: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 case 6,7,8: printf("Лето"); break;
         ^
prog.c:7:9: warning: statement with no effect [-Wunused-value]
prog.c:8:7: error: expected ‘:’ or ‘...’ before ‘,’ token
 case 9,10,11: printf("Осень"); break;
       ^
prog.c:8:7: error: expected expression before ‘,’ token
prog.c:8:7: warning: left-hand operand of comma expression has no effect [-Wunused-value]
prog.c:8:10: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 case 9,10,11: printf("Осень"); break;
          ^
prog.c:8:10: warning: statement with no effect [-Wunused-value]
prog.c:10:1: warning: implicit declaration of function ‘getchar’ [-Wimplicit-function-declaration]
 getchar();
 ^~~~~~~
prog.c:10:1: note: ‘getchar’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
stdout
Standard output is empty