📄 时钟夹角.cpp
字号:
#include <stdio.h>
#include <math.h>
void main()
{
int h,m;
float a;
while(1)
{
scanf("%d %d",&h,&m);
if(h==0&&m==0)
break;
else
{
a=(float)m/60*360-((float)m/60*30+h*30);
m<10?printf("At %d:0%d the angle is ",h,m):printf("At %d:%d the angle is ",h,m);
a>180?printf("%.1f degrees.\n",360-a):a>0?printf("%.1f degrees.\n",a):a>-180?printf("%.1f degrees.\n",-a):printf("%.1f degrees.\n",360+a);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -