题解 | #判断季节#

判断季节

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

#include <iostream>
#include <string>
using namespace std;

int main() {
    
    int month;
    string result;
    cin >> month;
    if(month>12||month<1){
        cout<<"不合法"<<endl;
        return 0;
    }
    else {
    result=month<3?"冬季":(month<6?"春季":(month<9?"夏季":(month<12?"秋季":"冬季")));
    cout<<result<<endl;
    return 0;
    }
    



    // write your code here......
    

    return 0;
}

全部评论

相关推荐

肥肠椒绿:双非本可不就犯天条了,双非本就应该打入无间地狱
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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