求大神,急需c语言编程计算1/99+2/98+……+1并输出
求大神,急需c语言编程计算1/99+2/98+……+1并输出
日期:2021-12-28 11:54:08 人气:1
double f = 1;
double s = 99;
double max_ = 0;
for(int n = 0; n < (f+s)/2 ;n++){
max_ += (f+n)/(s - n);
}
printf("%f",max_);
double s = 99;
double max_ = 0;
for(int n = 0; n < (f+s)/2 ;n++){
max_ += (f+n)/(s - n);
}
printf("%f",max_);