Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
141191 万麟峰 判断完全数 C++ Compile Error 0 MS 0 KB 213 2025-12-21 12:24:13

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:9: error: 's' was not declared in this scope
  cin>>n,s=0;
         ^