因为痛,所以叫青春

我有一个梦想:穷屌丝变身富屌丝
uva579 ClockHands

错的很狗血

View Code
#include<stdio.h>
#include<math.h>
int main()
{
    double m, n, t;
    char ch;
    while(scanf("%lf%c%lf",&m,&ch,&n) && (m||n))
    {
        if(n == 0)
            m = m*30;
        else
            m = m*30+0.5*n;
        n = n*6;
        t = fabs(m-n);
        if(t>180)
            t = 360.0-t;
        printf("%.3lf\n",t);
    }
    return 0;
}

 

posted on 2012-08-02 11:20  Nice!  阅读(124)  评论(0编辑  收藏  举报