题解
2025-11-27 20:37:34
发布于:湖南
10阅读
0回复
0点赞
#include <iostream>
#include <string>
using namespace std;
int main() {
// 定义星期名称数组(对应:星期一、星期二、...、星期日)
string week[] = {"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"};
long long n;
cin >> n;
// 今天是星期一(对应索引0),经过n天后的索引为 (0 + n) % 7
int idx = n % 7;
cout << week[idx] << endl;
return 0;
}
这里空空如也







有帮助,赞一个