A299.计算日期题解
2024-12-15 10:05:59
发布于:广东
0阅读
0回复
0点赞
#include<iostream>
using namespace std;
void x(int x){
if(x==1)cout<<"monday";
else if(x==2)cout<<"tuesday";
else if(x==3)cout<<"wednesdy";
else if(x==4)cout<<"thursday";
else if(x==5)cout<<"friday";
else if(x==6)cout<<"saturday";
else cout<<"sunday";
}
int main(){
int n;
cin>>n;
if(1+n>7&&(1+n)%7==0)x(7);
else if(1+n<=7)x(1+n);
else x((1+n)%7);
}
这里空空如也
有帮助,赞一个