#include<bits/stdc++.h>
using namespace std;
int main() {
int a, b, c=1;
cin >> a >> b;
for (int i = 1; i <= b; i++) {
c *= a;
c %= 7;
}
if (c == 0) {
cout << "Sunday";
}
else if (c == 1) {
cout << "Monday";
}
else if (c == 2) {
cout << "Tuesday";
}
else if (c == 3) {
cout << "Wednesday";
}
else if (c == 4) {
cout << "Thursday";
}
else if (c == 5) {
cout << "Friday";
}
else if (c == 6) {
cout << "Saturday";
}
return 0;
}
不要嫌弃if
标签:std,题目,int,namespace,cin,计算,using,周几,main From: https://blog.csdn.net/2301_76217337/article/details/140187635