Răspuns :
# include<iostream>using namespace std;long long perfect(long long n){ int d; long long s=1; if (n<3) return 0; else { for(d=2; d*d<=n; d++) if(n%d==0) { s=s+d; if(d!=n/d) s=s+(n/d); } if(n==s) return 1; } return 0;} int main() { long long n; cin>>n; if(perfect(n)==1) cout<<n<<" este perfect"; else cout<<n<<" nu este perfect"; return 0;
#include <iostream>
using namespace std;
int main()
{
int n,i,S=0;
cin>>n;
for(i=1;i<=n;i++)
{
if(n%i==0)
S=S+(n/i);
}
if(S%n==0)
cout<<n<<" "<<"este perfect";
else
cout<<n<<" "<<"nu este perfect";
return 0;
}
btw e de 90
btw e de 90