想写一个不用for的代码,结果WA,向各位大佬求调
代码如下:
#include <bits/stdc++.h>
using namespace std;
int main(){
int x , n;
cin >> x >> n;
if(n == 0) return puts("0") , 0;
if(x % 7 == 6) {
x ++;
n --;
}
if(x % 7 == 0) {
x ++;
n --;
}
if(x + n - 1 % 7 == 0) n --;
if(x + n - 1 % 7 == 6) n --;
cout << (n - (((n + x - 1) / 7) - (x / 7)) * 2) * 250 << "\n";
}