switch
2023-07-24 18:27:35
发布于:河北
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int weekday;
cin>>weekday;
switch(weekday){
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;
default : cout<<"error"<<endl;break;
}
return 0;
}
这里空空如也
有帮助,赞一个