题解 | 四季
四季
https://www.nowcoder.com/practice/eaf21203b61b4a689987fdc165d00dfc
#include <iostream>
using namespace std;
int main (){
int YM = 0 ;
cin >> YM ;
int e = YM % 10;
int s = YM % 100 / 10;
int season = 10*s + e ;
if (season <= 5){
if ( season >= 3 ){
cout << "spring" << endl;
}
else {
cout << "winter" << endl;
}
}
else {
if ( season <= 8 ){
cout << "summer" <<endl;
}
else {
if ( season != 12 ){
cout << "autumn" << endl;
}
else {
cout << "winter" << endl;
}
}
}
return 0 ;
}

OPPO公司福利 1225人发布