题解
2024-01-14 16:15:13
发布于:广东
2阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
int n;
cin>>n;
switch(n)//不能是double类型
{
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;
case 7:
cout<<"Sunday"<<endl;
break;
}
}
全部评论 1
懒得用if
2024-01-14 来自 广东
0
有帮助,赞一个