AcWing 2876. 日期识别
原题链接
简单
作者:
标致
,
2021-04-17 16:36:20
,
所有人可见
,
阅读 384
#include <bits/stdc++.h>
using namespace std;
map <string, int> mouth;
string s;
int main(){
mouth["Jan"] = 1;
mouth["Feb"] = 2;
mouth["Mar"] = 3;
mouth["Apr"] = 4;
mouth["May"] = 5;
mouth["Jun"] = 6;
mouth["Jul"] = 7;
mouth["Aug"] = 8;
mouth["Sep"] = 9;
mouth["Oct"] = 10;
mouth["Nov"] = 11;
mouth["Dec"] = 12;
cin >> s ;
string a = s.substr(0, 3);
string b = s.substr(3, 5);
int res = 0;
res = (b[0] - '0') * 10 + (b[1] - '0');
cout << mouth[a] << " " << res << endl;
return 0;
}