poj 2276 Model Rocket Height

poj 2276 Model Rocket Height

公式题
#include  < stdio.h >
#include 
< math.h >

const   double  pi = 3.141592653 ;
double  d, H, e = 0.00000001 ;

int  main()
{

    scanf( " %lf%lf " & d,  & H);
    
double  a, b, c, h;
    
while  ( scanf( " %lf%lf%lf " & a,  & b,  & c), a  >  e  &&  b  >  e  &&  c  >  e )
    {
        a
= tan(a / 180 * pi);
        b
= tan(b / 180 * pi);
        c
= tan(c / 180 * pi);
        h
= H + d * sqrt( 2.0 / ( 1 / a / a + 1 / c / c - 2 / b / b)) + 0.49999999 ;
        
int  t = h;
        printf(
" %d\n " , t);
    }
    
return   0 ;
}

你可能感兴趣的:(poj 2276 Model Rocket Height)