#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;
}
输入一个数字,输出对应的月份单词
C++实验:月份转换
最新推荐文章于 2025-03-04 17:49:40 发布