题解 | 判断季节

#include <iostream>
using namespace std;
#define moth_choose(month)\
if(month<1||month>12)\
{\
cout<<"不合法"<<endl;\
}\
else if(month>=3&&month<=5)\
{\
cout<<"春季"<<endl;\
}\
else if(month>=6&&month<=8)\
{\
    cout<<"夏季"<<endl;\
}\
else if(month>=9&&month<=11)\
{\
    cout<<"秋季"<<endl;\
}\
else\
{\
    cout<<"冬季"<<endl;\
}
int main() {
    
    int month;
    cin >> month;

    // write your code here......
    moth_choose(month);


    return 0;
}

全部评论

相关推荐

06-02 15:53
阳光学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务