#include<stdio.h>doubleping(int n){
int sum = 0;
for (int i = 1; i <= n; i++)
{
sum += i * i;
}
return sum;
}
intmain(){
double res = (ping(12) + (ping(15) * ping(15)));
printf("结果是:%f", res);
return0;
}
无声远望的博客以下是求1的平方到n的平方和的C语言代码: #include <stdio.h> int main() { int n, i, sum = 0; printf("请输入正整数n:"); scanf("%d", &n); for (i = 1; i <= n; i++) { sum += i * i; ...