编辑代码

#include <stdio.h>
#include <math.h>

void main(){
    float temp=0.0,m=0.0,sum=0.0,n=2.0;
    if(n==1.0){
    printf("值为:%f",sum);
}else{
    temp=(float)sqrt(n*2-1);
    sum+=temp;
    n--;
}
  }