悬关求助 #8 WA
查看原帖
悬关求助 #8 WA
1028403
封禁用户楼主2024/1/7 09:04

rt.

#include <iostream>
using namespace std;
string month[] = {"#","January","February","March","April","May","June","July","August","September","October","November","December"};
int main()
{
    string s;
    int k;
    cin >> s >> k;
    int a;
    for (int i = 1; i <= 12; i++)
        if (month[i] == s)
            a = i;
    a = (a + k) % 12;
    cout << month[a] << endl;
    return 0;
}
2024/1/7 09:04
加载中...