Răspuns :
#include<iostream>
using namespace std;
int main ()
{
int n,d,s=1;
cout<<"Dați numărul n=");
cin>>n;
s+=n;
for(d=1;d<n;i++)
if(n%d==0)
s=s+d;
if(s%n==0)
cout<<"DA";
else
cout<<"NU";
return 0;
}
using namespace std;
int main ()
{
int n,d,s=1;
cout<<"Dați numărul n=");
cin>>n;
s+=n;
for(d=1;d<n;i++)
if(n%d==0)
s=s+d;
if(s%n==0)
cout<<"DA";
else
cout<<"NU";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n,s=0;
cin>>n;
for(int d=1;d<=n;d++)
{
if(n % d == 0)
{
s += d;
}
}
if(s % n == 0)
{
cout<<"DA";
}
else
{
cout<<"NU";
}
}
using namespace std;
int main()
{
int n,s=0;
cin>>n;
for(int d=1;d<=n;d++)
{
if(n % d == 0)
{
s += d;
}
}
if(s % n == 0)
{
cout<<"DA";
}
else
{
cout<<"NU";
}
}