编译没错!运行错误!大家指点一下
#include "iostream.h"#include "stdlib.h"
#include "math.h"
double sin(int a);
double sqrt(double a);
double cosn(int a);
int main()
{
const double pi=3.14f;
int a;
cout<<"请输入角度:";
cin>>a;
cout<<cosn(a)<<endl;
return 0;
}
double cosn(int a)
{
const double pi=3.14f;
double sum;
sum=sqrt(1-sin(a/360*2*pi)*sin(a/360*2*pi));
return sum;
}
没次运行都是1!!!怎么回事啊?
[[it] 本帖最后由 lockhawk 于 2008-9-23 18:14 编辑 [/it]]