编程语言
首页 > 编程语言> > 1182 AE: 《C语言程序设计》江宝钏主编-习题8-5-月份全名

1182 AE: 《C语言程序设计》江宝钏主编-习题8-5-月份全名

作者:互联网

问题描述

**输入一个整型数,输出与该书对应的月份的英文月名。例如输入"3",则输出March。

|1 |2|3 4 5 6 7 8 9 10 11 12
January February March April May June July August September October November December**

1 2 3 4 5 6 7 8 9 10 11 12
January February March April May June July August September October November December

输入

整数月份

输出

英文月份

样例输入

3

样例输出

March

AC代码

#include <iostream>
using namespace std;


int main()
{
    int n;
    cin >> n;
    switch(n)
    {
        case 1:
            cout << "January" << endl;
            break;
        case 2:
            cout << "February" << endl;
            break;
        case 3:
            cout << "March" << endl;
            break;
        case 4:
            cout << "April" << endl;
            break;
        case 5:
            cout << "May" << endl;
            break;
        case 6:
            cout << "June" << endl;
            break;
        case 7:
            cout << "July" << endl;
            break;
        case 8:
            cout << "August" << endl;
            break;
        case 9:
            cout << "September" << endl;
            break;
        case 10:
            cout << "October" << endl;
            break;
        case 11:
            cout << "November" << endl;
            break;
        case 12:
            cout << "December" << endl;
            break;
    }
    return 0;
}

villaaaaaaa 发布了119 篇原创文章 · 获赞 28 · 访问量 4万+ 私信 关注

标签:输出,AE,August,int,样例,江宝钏,March,习题,输入
来源: https://blog.csdn.net/weixin_41179709/article/details/103989091