7-6 输出月份对应的英文名称 (10 分)
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
string months[13] = {
"", "January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"
};
int main()
{
int T, p;
cin >> T;
while (T--) {
cin >> p;
if (p > 12 || p < 1) cout << "Wrong input!" << endl;
else cout << months[p] << endl;
}
return 0;
}
7-6 输出月份对应的英文名称 (10 分)
最新推荐文章于 2023-11-08 18:55:21 发布