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

233333

Posted by KatrineYang at 2016-11-05 13:07:41 on Problem 2840
//============================================================================
// Name        : main2840.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int main() {
	int n;
	scanf("%d", &n);
	for(int ii = 0; ii < n; ii++){
		char t[10];
		scanf("%s", t);
		int l = strlen(t);
		int h = 0, m = h;
		int i = 0;
			while(t[i] != ':'){
				h *= 10;
				h += (t[i] - '0');
				i++;
			}
			i++;
			while(i < l){
				m *= 10;
				m += (t[i] - '0');
				i++;
			}
		printf("%d\n", m ? 0 : (h+11)%24+1);
	}
	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