1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【额外练习】选择结构/7-28 选择-时钟.c

17 lines
240 B
C

#include <stdio.h>
int main() {
int h, m;
scanf("%d:%d", &h, &m);
double angle = 30 * h - 5.5 * m;
if (angle < 0) angle = -angle;
if (angle > 180) angle = 360 - angle;
printf("%.3lf\n", angle);
return 0;
}