01: #include <stdio.h> 02: 03: int main(void){ 04: int i, j, sum; 05: 06: for(i=1; i<=1000; i++){ 07: sum = 0; 08: 09: for(j=1; j<=i; j++){ 10: if(i%j != 0)continue; //割り切れない場合,以下の処理をスキップ 11: sum += j; 12: } 13: 14: printf("%d\t%d\n",i,sum); 15: } 16: 17: return 0; 18: }