题解 | #判断季节#

判断季节

https://www.nowcoder.com/practice/741a9b79fabe474cb153a49b4bff5828

#include <iostream>
using namespace std;

int main() {
    
    int month;
    cin >> month;
    if (month>=3&&month<=5)cout<<"春季"<<endl;
    else if(month>=6&&month<=8)cout<<"夏季"<<endl;
    else if(month>=9&&month<=11)cout<<"秋季"<<endl;
    else if((month==12)||(month==1)||month==2)cout<<"冬季"<<endl;
    else {cout<<"不合法"<<endl;}
    // write your code here......
    

    return 0;
}

全部评论

相关推荐

累死的一条狗:稀有人才啊你简历写了啥他这么锲而不舍的问你
点赞 评论 收藏
分享
01-14 12:34
门头沟学院 C++
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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