Zadatak5-15

#include <iostream>

using namespace std;

int main()
{
int i,n,s,j;
cin>>n;
for(i=1;i<n;i++)
{ s=0;
for(j=1;j<i;j++)
if(i%j==0)
s=s+j;
if(i==s)
cout<<i<<“ „;
}
return 0;
}

Advertisements