Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
35617 | 徐若宸 | 求完数 | C++ | Accepted | 0 MS | 256 KB | 282 | 2024-01-04 20:50:31 |
#include <bits/stdc++.h> using namespace std; bool w(int n){ int cmp=0; for(int i=1;i<=n/2;i++){ if(n%i==0)cmp+=i; } return n==cmp; } int main(){ int n,cmp=0; cin>>n; for(int i=6;i<n;i++){ if(w(i)){ cout<<i<<endl; cmp++; } } cout<<"*"<<cmp; }