#include<stdio.h>
int main()
{
int i, m, n;
double sum, item;
scanf("%d %d", &m, &n);
sum = 0;
for(i=m; i<=n; i++){
item = i*i+1.0/i;
sum = sum+item;
}
printf("sum = %.6f", sum);
return 0;
}
标签:平方,倒数,int,double,sum,item,习题,main
来源: https://www.cnblogs.com/ytmsnzy/p/16587873.html