http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1328

题目认真分析一下不难,理论结合特例就知道了什么关系.

我想到了运动的分解与合成,行走的总距离LSum就等于水平方向总距离LH和垂直方向LV距离的合成,即LSum*LSum=LV*LV*LH*LH.

LV,LH分析一下即可得.学到了:

1.弧度和角度的转换⊙﹏⊙b汗. http://blog.sina.com.cn/s/blog_7ff0f30f01011hkf.html

2.函数 asin(x). -1<=x<=1 ,返回的是double而且是个弧度.http://baike.baidu.com/view/653924.htm

#include <stdio.h>
#include <math.h>

const double PI=acos(-1.0);

int main(void)
{
    int a,b,s,m,n;
    while (scanf("%d %d %d %d %d",&a,&b,&s,&m,&n))
    {
        if (!a&&!b&&!s&&!m&&!n)
        {
            break;
        }

        double A,V,LH,LV,LSum;

        LH=m*a,LV=n*b;
        LSum=sqrt(LV*LV+LH*LH);

        V=LSum/s;
        A=asin(LV/LSum);
        A=A*180/PI;
        printf("%.2f %.2f\n",A,V);
    }
    return 0;
}

 

posted on 2013-05-06 16:08  简单的信仰  阅读(157)  评论(0编辑  收藏  举报