c语言程序求答案和解析
#include<stdio.h>doublef(doublex,doubley){if(x>=y)return(x+y)/2.0;elsereturnf(f(x+2,y...
#include<stdio.h>
double f(double x,double y)
{if(x>=y)
return (x+y)/2.0;
else
return f(f(x+2,y-1),f(x+1,y-2));
}
void main (){
printf ("%.1f",f(5.0,7.0));
} 展开
double f(double x,double y)
{if(x>=y)
return (x+y)/2.0;
else
return f(f(x+2,y-1),f(x+1,y-2));
}
void main (){
printf ("%.1f",f(5.0,7.0));
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询