| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 51642 | littletwleve | 求正整数2和n之间的完全数 | C++ | Accepted | 0 MS | 240 KB | 292 | 2024-09-23 12:29:22 |
#include<bits/stdc++.h> using namespace std; bool ycount(int x){ int cnt=0; bool flag=0; for(int i=1;i<x;i++){ if(x%i==0) cnt+=i; } if(cnt==x) flag=1; return flag; } int main(){ int n; cin>>n; for(int i=2;i<=n;i++){ if(ycount(i)) cout<<i<<endl; } return 0; }