题解 | #判断季节#

判断季节

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

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

int main() {
    
    int month;
    cin >> month;
    if(month>12 || month<1)
    {
        cout<<"不合法"<<endl;
        return 0;
    }
    string Mt[12]={"冬季","冬季","春季","春季","春季","夏季","夏季","夏季","秋季","秋季","秋季","冬季"};

    // write your code here......
    cout<<Mt[month-1]<<endl;
    

    return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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