用double定义函数,返回类型为float
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <math.h>
/*************found**************/
double fun(int k)
{
int n; float s, w, p, q;
n=1;
s=1.0;
while(n<=k)
{
w=2.0*n;
p=w-1.0;
q=w+1.0;
s=s*w*w/p/q;
n++;
}
/*************found**************/
return s;
}
void main()
{ system("CLS");
printf("%f\n ",fun(10));
}
不是说返回值要和函数定义类型一样么