您的位置首页百科问答 c语言程序设计题目跪求解答, 计算2~2015之间所有完数之和 Simone 发布于 2024-10-10 22:05:04 591 阅读 #include int main(){int i,j;int sum=0, sum1;for (i = 3; i < 2015; i++){sum1 = 0;for (j = 1; j < i; j++)if (i%j == 0)sum1 += j;if (sum1 == i)sum += i;}printf("sum=%d", sum);return 0;}