Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
75742 sh25_zhuwy 求正整数2和n之间的完全数 C++ 通过 0 MS 252 KB 269 2025-12-10 11:19:08

Tests(1/1):


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


测评信息: