... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-10221 :: Satellites

#include <bits/stdc++.h>
using namespace std ;
int main ()
{
    double s, r=6440.0 ,d ,x ,arc ,cord ,pi ;
    string sr ;int a ;
    pi=2.0*acos(0.0) ;

    while (cin>>d>>a>>sr)
    {
        if (a>180) a=360-a ;
        s=d+r ;
        if (sr=="deg")   x= (a*pi)/180.0 ;
        else if (sr=="min")  x=(a*pi)/(60.0*180.0) ;
        arc=s*x ;

        cord=sqrt ((s*s+s*s) - 2.0*s*s*cos(x) );

       printf ("%.6lf %.6lf\n",arc,cord) ;
    }

    return 0 ;
}