题解
2025-02-09 12:54:02
发布于:江苏
4阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main() {
int n;
cin>>n;
int x=(n+1)%7;
if(x==1){
cout<<"monday";
}else if(x==2){
cout<<"tuesday";
}else if(x==3){
cout<<"wednesday";
}else if(x==4){
cout<<"thursday";
}else if(x==5){
cout<<"friday";
}else if(x==6){
cout<<"saturday";
}else if(x==0){
cout<<"sunday";
}
return 0;
}
#include<iostream>
using namespace std;
int main() {
int n;
cin>>n;
int x=(n+1)%7;
if(x==1){
cout<<"monday";
}else if(x==2){
cout<<"tuesday";
}else if(x==3){
cout<<"wednesday";
}else if(x==4){
cout<<"thursday";
}else if(x==5){
cout<<"friday";
}else if(x==6){
cout<<"saturday";
}else{
cout<<"sunday";
}
return 0;
}
这里空空如也
有帮助,赞一个