#include <iostream.h>
#include <fstream.h>
#include <stdio.h>
void writeinfile(int n);
void main()
{
int m,n,k,s,l;
/**********Program**********/
n=0;
for(m=1;m<=200;m++)
{
s=0;
for(k=1;k<m;k++)
{
if(m%k==0)
s+=k;
}
if(s==m)
{
cout<<m<<endl;
n++;
}
}
cout<<n;
/********** End **********/
writeinfile(n);
}
void writeinfile(int n)
{
fstream myfile;
myfile.open(" f.txt" ,ios::out);
myfile<<n<<endl;
myfile.close();
}
10-08