#include //头文件void main(){ int x,i,s=0; for(x=1;x<=1000;x++) { s=0; //这里每次都要初始化 for(i=1;i if(x%i==0) s=s+i; if(x==s) printf("%d ",x); }}