这个代码发上去说是输出超出限制怎么办
#include <stdio.h>double f(double a,double b){
double sum=0,c,d;
c=a;d=b;
if(a<0){
sum=a+b;
}
if(a==0){
sum=b-1;
}
if(a>0){
for(int i=1;a-i>=0;i++){
sum=sum+a/b;
b=a+b;
a=a-1;
}
sum=a+b;
}
return sum;
}
int main(){
double x,y;
while(1){
scanf("%lf %lf",&x,&y);
printf("%.2lf\n",f(x,y));
}
return 0;
}