#includedouble x=1,s1=0,s2=0,s3=0,result; int main()//main函数记得返回return 0 void不需要return 0 { while (x<=100)//while循环语句基本结构,需要记住自己加上i++自增 { s1 += x; x++; } for (int i = 1; i <= 50; i++) { s2 += i * i; } for (double m = 1; m <= 10; m++)//输出要求4位小数,避免后期精度问题建议用double double的输入要用%lf { s3 += (1 / m);//涉及加减乘除运算时记得加上() } result = s1 + s2 + s3; printf("%.4f", result); return 0; }



