Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150348 赖泓宇 判断完全数 C++ Wrong Answer 1 MS 268 KB 531 2026-03-27 18:36:39

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n=0,i=1,s=0; cin>>n; while(n!=0){ if(n%i==0){ s=s+i; } i++; if(n=n){ break; } } if(n%s==0){ cout<<"YES"; }else{ cout<<"NO"; } }


Run Info:

------Input------
787
------Answer-----
NO
------Your output-----
YES