本文主要是介绍c语言程序设计实践江宝钏,1182 AE: 《C语言程序设计》江宝钏主编-习题8-5-月份全名...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题描述
**输入一个整型数,输出与该书对应的月份的英文月名。例如输入"3",则输出March。
|1|2|3456789101112
JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember**
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
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
这篇关于c语言程序设计实践江宝钏,1182 AE: 《C语言程序设计》江宝钏主编-习题8-5-月份全名...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!