//直接就可以写出来了,很简单的一题!
#include "iostream"
using namespace std;
int main()
{
int a;
while (cin >> a && a != -1)
{
if (a == 0)
cout << "Exactly 3 o'clock" << endl;
else if (a > 0 && a < 30)
cout << "Between 2 o'clock and 3 o'clock" << endl;
else if (a == 30)
cout << "Exactly 2 o'clock" << endl;
else if (a > 30 && a < 60)
cout << "Between 1 o'clock and 2 o'clock" << endl;
else if (a == 60)
cout << "Exactly 1 o'clock" << endl;
else if (a > 60 && a < 90)
cout << "Between 0 o'clock and 1 o'clock" << endl;
else if (a == 90)
cout << "Exactly 0 o'clock" << endl;
else if (a > 90 && a < 120)
cout << "Between 11 o'clock and 0 o'clock" << endl;
else if (a == 120)
cout << "Exactly 11 o'clock" << endl;
else if (a > 120 && a < 150)
cout << "Between 10 o'clock and 11 o'clock" << endl;
else if (a == 150)
cout << "Exactly 10 o'clock" << endl;
else if (a > 150 && a < 180)
cout << "Between 9 o'clock and 10 o'clock" << endl;
else if (a == 180)
cout << "Exactly 9 o'clock" << endl;
else if (a > 180 && a < 210)
cout << "Between 8 o'clock and 9 o'clock" << endl;
else if (a == 210)
cout << "Exactly 8 o'clock" << endl;
else if (a > 210 && a < 240)
cout << "Between 7 o'clock and 8 o'clock" << endl;
else if (a == 240)
cout << "Exactly 7 o'clock" << endl;
else if (a > 240 && a < 270)
cout << "Between 6 o'clock and 7 o'clock" << endl;
else if (a == 270)
cout << "Exactly 6 o'clock"<< endl;
else if (a > 270 && a < 300)
cout << "Between 5 o'clock and 6 o'clock" << endl;
else if (a == 300)
cout << "Exactly 5 o'clock" << endl;
else if (a > 300 && a < 330)
cout << "Between 4 o'clock and 5 o'clock" << endl;
else if (a == 330)
cout << "Exactly 4 o'clock" << endl;
else if (a > 330 && a < 360)
cout << "Between 3 o'clock and 4 o'clock" << endl;
}
}
zoj 3191 Strange Clock
最新推荐文章于 2015-07-27 21:32:47 发布