hdu 3248

来源:互联网 发布:skype6 下载 mac 编辑:程序博客网 时间:2024/06/13 20:39

题解思路:


如图你会发现他其实是这样的时钟那么再将这个时钟顺时针旋转270度得到的就是现在位置 = (12-正常时钟位置)%12。

代码:

#include<bits/stdc++.h>using namespace std;typedef long long ll;const int mx = 2e6+10;int n,m,k;int main(){    while(scanf("%d",&n)&&n!=-1){        n = (n+270)%360;        m = n / 30;        if(n%30==0) printf("Exactly %d o'clock\n",(12-m)%12);        else printf("Between %d o'clock and %d o'clock\n",(12-m-1)%12,(12-m)%12);    }    return 0;}