C++实验:月份转换

#include <iostream>
using namespace std;
int main()
{
	char month[12][10] = { "January", "February", "March", "April", "May", "June",
		"July", "August", "September", "October", "November", "December" };
	int m;
	cin >> m;
	if (m>0 && m<13)
		cout << month[m - 1];
	else
		cout << "The month is wrong";
	return 0;
}
输入一个数字,输出对应的月份单词

猜你喜欢

转载自blog.csdn.net/fly_wt/article/details/79841992
今日推荐