求日期代码
2024-07-21 14:50:31
发布于:广东
1阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
if(n>=7){
n%=7;
}
n+=1;
if(n1){
cout << "monday";
}else if(n2){
cout << "tuesday";
}else if(n3){
cout << "wednesday";
}else if(n4){
cout << "thursday";
}else if(n5){
cout << "friday";
}else if(n6){
cout << "saturday";
}else if(n==7){
cout << "sunday";
}
return 0;
}
这里空空如也
有帮助,赞一个