I get this code WA. I just use cos low to figure out the answer. What's wrong with the code?
[c]
#include<stdio.h>
#include<math.h>
#include<string.h>
#define PI 3.14159265358979323846
void main(void)
{
double a,s;
char data[4];
while(scanf("%lf %lf %s",&s,&a,data)!=EOF)
{
if(strcmp(data,"deg")==0)
printf("%.6lf ",(6440+s)*(a*PI/180));
else
printf("%.6lf ",(6440+s)*(a/60*PI/180));
if(strcmp(data,"min")==0)
a/=60;
printf("%.6lf\n",sqrt(2*(6440+s)*(6440+s)*(1-cos(a*PI/180))));
}
}
[/c]

