#include<stdio.h>
int main()
{
int i,j,n,he;
i=1;
printf("input a number:");
scanf("%d",&n);
while(i<=n)
{
j=1;he=0;
while(j<i)
{
if(i%j==0)
he+=j;
j++;
}
if(i==he)
printf("%d\n",i);
i++;
}
return 0;
}
标签:输出,int,代码,C语言,++,while,printf,he From: https://www.cnblogs.com/xinjingnanqiu/p/17069035.html