Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
79227 刘慕莀 判断完全数 C++ Compile Error 0 MS 0 KB 225 2024-06-30 15:23:14

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a,sum=0; cin>>a; for(int i,i<=a,i++){ if(a%i==0){ sum+i; } } if(sum==a){ cout<<"YES"; }else{ cout<<"NO"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:16: error: expected ';' before '<=' token
     for(int i,i<=a,i++){
                ^
Main.cc:6:16: error: expected primary-expression before '<=' token
Main.cc:6:23: error: expected ';' before ')' token
     for(int i,i<=a,i++){
                       ^
Main.cc:8:9: warning: statement has no effect [-Wunused-value]
      sum+i; 
         ^