c语言编程sum=1^1+2^2+3^3+……+10^10

2024-12-17 02:15:03
推荐回答(1个)
回答1:

int i, sum;
sum=0;
for (i=1; i<=10; i++)
sum+=i*i;
printf("sum=[%d]\n", sum);