Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:继续水~~~~

Posted by like680623 at 2011-02-05 21:11:40 on Problem 2840
#include<iostream>
#include<fstream>
#include<string>
using namespace std;

int main()
{
	int tot, x, y;
	cin>>tot;
	while (tot--)
	{
		scanf("%d:%d", &x, &y);
		if (y)
		{
			printf("0\n");
			continue;
		}
		if (x >= 1 && x <= 12)
			printf("%d\n", x + 12);
		else if (x >= 13 && x < 24)
			printf("%d\n", x - 12);
		else printf("12\n");
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator