HOJ 1010
又是一道模拟题
题解就不写了
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; inline int read(){ int x=0,f=1,ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } int h,m; int main(){ h=read(),m=read(); while(h!=0||m!=0){ int a1=720/60*m; int a2=720/12*h+60/60*m; if(a1>a2){ int temp=a1;a1=a2;a2=temp; } int ans=min(a2-a1,720-a2+a1); if(ans&1) printf("At %d:%02d the angle is %d.5 degrees.\n",h,m,ans>>1); else printf("At %d:%02d the angle is %d.0 degrees.\n",h,m,ans>>1); h=read(),m=read(); } return 0; }