有关c语言程序的问题
#include<iostream>#include<cmath>
using namespace std;
int main()
{double sin(double);
double r,s,k;
cin>>r>>s;
if(r*r<=s*s)
k=sqrt(sin(r)*sin(r)+sin(s)*sin(s));
else
k=1*sin(r*s)/2;
cout<<k<<endl;
return 0;
}
double sin(double x)
{int n=1,j=-1,f=1;
double g=0,t=x,s;
while(fabs(s)>1e-6)
{
s=t/f;g=g+s;n++;
t=-t*x*x;
f=f*(2*n-1)*(2*n-2);
}
return (g);
}这个程序有什么问题,我找不出程序中得错误,请高人指点,输入5和8为啥运行不了