用户输出
49.0
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#48590 | #1139. ddd和鸽子 | Accepted | 100 | 41 ms | 348 K | C++ 17 (Clang) / 430 B | XYZ | 2021-05-15 19:19:33 |
#include <stdio.h>
float degree(int hh, int mm) {
float ratio1 = (float)(hh * 60 + mm) / (720.0);
float ratio2 = (float)mm / 60;
float res = 360 * ratio1 - 360 * ratio2;
if (res < 0)
res = -res;
if (res > 180)
res = 360.0 - res;
return res;
}
int main() {
char time[6];
scanf("%s", time);
int hh = (time[0] - '0') * 10 + time[1] - '0';
int mm = (time[3] - '0') * 10 + time[4] - '0';
printf("%.1f", degree(hh % 12, mm));
return 0;
}