请教C++语言代码问题,帮我看看这段代码是什么东西,谢谢
建立一个记事本然后输入
#include"iostream.h"
void main()
{
//void wanshuf();
//wanshuf();
int i,j,t,f;
for(i=2;i<=1000;i++)
{
{
f=0;
for(t=1;t<i;t++)
if(i%t==0)
f=f+t;
if(f==i)
cout<<i<<"-->";
for(j=1;j<i;j++)
if(i%j==0&&f==i)
cout<<j<<","<<'\t';
}
//cout<<endl;
}
}
/*void wanshuf()
{
int i,j,t,f;
for(i=2;i<=100;i++)
{
{
f=0;
for(t=1;t<i;t++)
if(i%t==0)
f=f+t;
if(f==i)
cout<<i<<"-->";
for(j=1;j<i;j++)
if(i%j==0&&f==i)
cout<<j<<","<<'\t';
}
//cout<<endl;
}
}*/
其中//为单行注释,而/*....*/为多行注释
注释为用子函数的形式实现
保存 后面改成 1.reg
建立一个记事本然后输入
#include"iostream.h"
void main()
{
//void wanshuf();
//wanshuf();
int i,j,t,f;
for(i=2;i<=1000;i++)
{
{
f=0;
for(t=1;t<i;t++)
if(i%t==0)
f=f+t;
if(f==i)
cout<<i<<"-->";
for(j=1;j<i;j++)
if(i%j==0&&f==i)
cout<<j<<","<<'\t';
}
//cout<<endl;
}
}
/*void wanshuf()
{
int i,j,t,f;
for(i=2;i<=100;i++)
{
{
f=0;
for(t=1;t<i;t++)
if(i%t==0)
f=f+t;
if(f==i)
cout<<i<<"-->";
for(j=1;j<i;j++)
if(i%j==0&&f==i)
cout<<j<<","<<'\t';
}
//cout<<endl;
}
}*/
其中//为单行注释,而/*....*/为多行注释
注释为用子函数的形式实现
保存 后面改成 1.reg










