题解 | #四季#
四季
http://www.nowcoder.com/practice/eaf21203b61b4a689987fdc165d00dfc
#include<stdio.h>
int main() {
int year, month;
scanf("%4d%02d", &year, &month);
switch (month) {
case 3:
case 4:
case 5: {
printf("spring");
}
break;
case 6:
case 7:
case 8: {
printf("summer");
}
break;
case 9:
case 10:
case 11: {
printf("autumn");
}
break;
case 12:
case 1:
case 2: {
printf("winter");
}
break;
}
return 0;
}
int main() {
int year, month;
scanf("%4d%02d", &year, &month);
switch (month) {
case 3:
case 4:
case 5: {
printf("spring");
}
break;
case 6:
case 7:
case 8: {
printf("summer");
}
break;
case 9:
case 10:
case 11: {
printf("autumn");
}
break;
case 12:
case 1:
case 2: {
printf("winter");
}
break;
}
return 0;
}