@root 为什么只有80分😭😭

3076768864 2024-04-29 20:46:54 2024-04-29 20:55:31 16

#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, s; cin >> m >> n; s = 0; i = m; while (i < n) { if (i % 7 == 0) s += i; i += 1; } cout << s; }

{{ vote && vote.total.up }}

共 3 条回复

wyh15 Minecraft
#include <bits/stdc++.h> 
using namespace std; 
int main() { 
int n, m, i, s; 
cin >> m >> n; 
s = 0; 
i = m; 
while (i < n) { 
if (i % 7 == 0) s += i; 
i+= 1; 
} 
cout << s; 
}
root 站长

条件写错了,万一 n 也是 7的倍数嘞?

3076768864

大神求解!!