题解 | #判断季节#
判断季节
https://www.nowcoder.com/practice/741a9b79fabe474cb153a49b4bff5828
#include <iostream>
using namespace std;
int main() {
int a;
scanf("%d",&a);
switch(a){
case 1:
case 2:
case 12: printf("冬季");
break;
case 3:
case 4:
case 5: printf("春季");
break;
case 6:
case 7:
case 8: printf("夏季");
break;
case 9:
case 10:
case 11: printf("秋季");
break;
default: printf("不合法");
break;
}
}
// 64 位输出请用 printf("%lld")