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