解题思路:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin>>a;
switch(a)
{
case 0:cout<<"Sunday"<<endl;break;
case 1:cout<<"Monday"<<endl;break;
case 2:cout<<"Tuesday"<<endl;break;
case 3:cout<<"Wednesday"<<endl;break;
case 4:cout<<"Thursday"<<endl;break;
case 5:cout<<"Friday"<<endl;break;
case 6:cout<<"Saturday"<<endl;break;
default:cout<<"input error!"<<endl;break;
}
return 0;
}
注意事项:
参考代码:
0.0分
1 人评分