题目网址:https://www.luogu.org/problemnew/show/CF290A
这题可真水。。
#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
string a[40]={ "Washington", "Adams", "Jefferson", "Madison", "Monroe", "Adams", "Jackson", "Van Buren", "Harrison", "Tyler", "Polk", "Taylor", "Fillmore", "Pierce", "Buchanan", "Lincoln", "Johnson", "Grant", "Hayes", "Garfield", "Arthur", "Cleveland", "Harrison", "Cleveland", "McKinley", "Roosevelt", "Taft", "Wilson", "Harding", "Coolidge", "Hoover", "Roosevelt", "Truman", "Eisenhower", "Kennedy", "Johnson", "Nixon", "Ford", "Carter", "Reagan" }; //所有名称
cin>>n; //输入第几任
cout<<a[n-1]; //输出
return 0; //完了over
}