问题描述
**输入一个整型数,输出与该书对应的月份的英文月名。例如输入"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万+
私信
关注