本人题解
2024-09-29 13:18:47
发布于:浙江
5阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int m,w = 0;
cin >> m;
if (m >= 7){
w = m % 7;
if (w == 0) cout << "Monday";
else if (w == 1) cout << "Tuesday";
else if (w == 2) cout << "Wednesday";
else if (w == 3) cout << "Thursday";
else if (w == 4) cout << "Friday";
else if (w == 5) cout << "Saturday";
else if (w == 6) cout << "Sunday";
}
else{
if (m == 0) cout << "Monday";
else if (m == 1) cout << "Tuesday";
else if (m == 2) cout << "Wednesday";
else if (m == 3) cout << "Thursday";
else if (m == 4) cout << "Friday";
else if (m == 5) cout << "Saturday";
else if (m == 6) cout << "Sunday";
}
}
这里空空如也
有帮助,赞一个