Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<iostream>#include<cstdio>#include<cstdlib>#include<cmath>#include<algorithm>#include<cstring>#define inf 0x7fffffff#define ll long longusing namespace std;inline ll read(){ll x=0,f=1;char ch=getchar();while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}void cal(){int T,h,m,s,tt;double angle1,angle2,ret;scanf("%d%d%d%d",&h,&m,&s,&tt);s+=tt;m+=s/60;s%=60;h+=m/60;m%=60;h%=12;if(h==0)h+=12;if(h>12)h-=12;angle1=30.0*h+30/60.0*m+30/3600.0*s;angle2=6.0*m+6/60.0*s;ret=angle1-angle2;ret=ret<0?-ret:ret;ret=ret>180?360-ret:ret;printf("%.4f\n",ret);