用户输出
49.0
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#25367 | #1139. ddd和鸽子 | Accepted | 100 | 59 ms | 360 K | C++ / 475 B | lvcs | 2020-04-26 21:34:58 |
#include <bits/stdc++.h>
using namespace std;
int main() {
char time[5];
double hh, mm, dec_hh, dec_mm, dec;
cin >> time;
hh = (time[0] - '0') * 10 + time[1] - '0';
mm = (time[3] - '0') * 10 + time[4] - '0';
if (hh >= 12)
hh = hh - 12;
dec_hh = hh * 30 + mm / 2;
dec_mm = mm * 6;
dec = dec_hh - dec_mm;
if (dec > 180)
dec = 360 - dec;
else if (dec < 0 && dec >= -180)
dec = -dec;
else if (dec < -180)
dec = 360 + dec;
else
dec = dec;
printf("%.1f", dec);
return (0);
}