#24584: C++AC(3ms,340kb)


ivywu__0818 (沁)

學校 : 臺北市立中崙高級中學
編號 : 146602
來源 : [114.37.190.142]
最後登入時間 :
2024-04-15 18:05:16
d095. 00579 - ClockHands -- UVa579 | From: [114.45.33.99] | 發表日期 : 2021-03-07 14:01

#include <iostream>

using namespace std;

int main(){

    int h,m;char dot;

    double total;

    while(1){

        cin>>h>>dot>>m;

        if((h == 0)&&(m==0)) break;

        double hd = h*30+m*0.5;

        double md = 6*m;

        total = abs(hd-md);

        if(total>180) total = 360-total;

        cout.precision(3);

        cout<<fixed<<total<<endl;

    }

}

 

 
ZeroJudge Forum