题解 | #判断季节#
判断季节
http://www.nowcoder.com/practice/741a9b79fabe474cb153a49b4bff5828
#include <iostream>
using namespace std;
int main() {
int month;
cin >> month;
// write your code here......
if(3<=month&&month<=5){
cout<<"春季"<<endl;
}
else if(6<=month&&month<=8){
cout<<"夏季"<<endl;
}
else if(9<=month&&month<=11){
cout<<"秋季"<<endl;
}
else if(month==12||month==1||month==2){
cout<<"冬季"<<endl;
}
else{
cout<<"不合法"<<endl;
}
return 0;
}