90pts求调
查看原帖
90pts求调
1052626
wangrunyang楼主2024/7/20 16:36

想写一个不用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";
}
2024/7/20 16:36
加载中...