Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7893 余立涵 判断完全数 C++ Accepted 0 MS 256 KB 293 2025-05-24 20:09:06

Tests(10/10):


Code:

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