Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
53754 | zhangsicun | 计算星期几 | C++ | 通过 | 0 MS | 248 KB | 526 | 2024-10-25 14:38:46 |
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int day = 1; for (int i = 1; i <= b; i++) { day *= a; } a = a%7-1; if(a == 1){ cout << "Monday"; } if(a == 2){ cout << "Tuesday"; } if(a == 3){ cout << "Wednesday"; } if(a == 4){ cout << "Thursday"; } if(a == 5){ cout << "Friday"; }if(a == 6){ cout << "Saturday"; }if(a == 0){ cout << "Sunday"; } }