36 lines
714 B
C
36 lines
714 B
C
#include <stdio.h>
|
|
|
|
int main(void) {
|
|
int month;
|
|
|
|
printf("月を入力してください: ");
|
|
scanf("%d", &month);
|
|
|
|
switch (month) {
|
|
case 12:
|
|
case 1:
|
|
case 2:
|
|
printf("%d月は冬です。\n", month);
|
|
break;
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
printf("%d月は春です。\n", month);
|
|
break;
|
|
case 6:
|
|
case 7:
|
|
case 8:
|
|
printf("%d月は夏です。\n", month);
|
|
break;
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
printf("%d月は秋です。\n", month);
|
|
break;
|
|
default:
|
|
puts("不明な月です。");
|
|
}
|
|
|
|
return 0;
|
|
}
|