题解 | #四季#
四季
https://www.nowcoder.com/practice/eaf21203b61b4a689987fdc165d00dfc
#include <stdio.h>
int main() {
int year, month;
while (scanf("%4d%2d", &year, &month) != EOF) { // 注意 while 处理多个 case
// 64 位输出请用 printf("%lld") to
if((month>=3)&&(month<=5))
printf("spring\n");
if((month>=6)&&(month<=8))
printf("summer\n");
if((month>=9)&&(month<=11))
printf("autumn\n");
if((month<=2)||(month>11))
printf("winter\n");
}
return 0;
}
查看8道真题和解析