请指教!!!
#include<stdio.h>int main()
{
int n,i,m,sum = 0;
scanf("%d",&n);
for(i = 1;i <= n;i++)
{
for(m = 1;m < i;m++)
{
if(i / m == 0)
sum = sum + m;
}
if(sum == i)
printf("%d",i);
}
return 0;
}
这个输出完数的程序哪里错了??
#include <stdio.h> int main( void ) { unsigned n; scanf( "%u", &n ); for( unsigned i=1; i<=n; ++i ) { unsigned sum = 0; for( unsigned m=1; m<i; ++m ) if( i%m == 0 ) sum += m; if( sum == i ) printf( "%u\n", i ); } }