有没有大佬帮我看看哪里错了?

wjl2014 2024-05-30 20:37:22 8

#include<bits/stdc++.h> using namespace std; int main() { int y,u=0; cin>>y; for(int h=1;h<=y;h++) { if(h%3==0) { u=u+y; } } cout<<u; return 0; }

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

共 1 条回复

root 站长

if(h%3==0) h能被3整除,你后面这个 u=u+y; 加 y ????