zoj 3191 Strange Clock

//直接就可以写出来了,很简单的一题!
#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;
	}
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值