题目思路
根据题意模拟,写一个 for 循环, 代表现在是计划开始的第 天,判断是不是星期一至星期五,如果是 ,否则 ,接着输出 即可。
AC Code
#include <bits/stdc++.h>
using namespace std;
signed main() {
int n = 2026;
//cin >> n;
int i;
for (i = 1; n > 0; i++)
n -= (i % 7 + 1 <= 5 ? 5 : 15);
cout << i << '\n';
return 0;
}