标签:image 完数 == png com java images its div
1 #include<stdio.h> 2 int main() 3 { 4 int i,j,k; 5 for(i=1;i<1000;i++) 6 { 7 int sum=0; 8 for(j=1;j<i;j++) 9 { 10 if(i%j==0){ 11 sum+=j; 12 } 13 } 14 if(sum==i){ 15 printf("%d its factors are ",i ); 16 for(k=1;k<i;k++) 17 { 18 if(i%k==0){ 19 printf("%d ",k);} 20 } 21 printf("\n"); 22 } 23 } 24 return 0; 25 }
比Java写的那个输出的更清楚!
标签:image 完数 == png com java images its div
原文地址:http://www.cnblogs.com/ieybl/p/6677542.html