poj2840,

## Problem:

Big Clock
 Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 6911 Accepted: 4410
Description
Our vicar raised money to have the church clock repaired for several weeks. The big clock, which used to strike the hours days and nights, was damaged several weeks ago and had been silent since then.

After the clock was repaired, it works all right, but there is still something wrong with it: the clock will strike thirteen times at one o’clock, fourteen times at two o’clock... 24 times at 12:00, 1 time at 13:00...

How many times will it strike now?
Input
The first line consists of only one integer T (T <= 30), representing the number of test cases. Then T cases follow.

Each test case consists of only one line, representing the time now. Each line includes 2 integers H, M separated by a symbol ":". (0 <= H < 24, 0 <= M < 60)
Output
For each test case, output the answer in one line.
Sample Input
```3
1:00
01:01
00:00```
Sample Output
```13
0
12```
Source
POJ Monthly--2006.06.25, Lei Tao

Easy forward.

## Source Code:

//Fri May 21 01:01:41 CDT 2010
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

int main(int argc, const char* argv[])
{
//  freopen("input.in", "r", stdin);
//  freopen("output.out", "w", stdout);
int T;
cin >> T;
while (T--)
{
int h, m;
scanf("%d:%d", &h, &m);
if (m != 0)
{
cout << "0" << endl;
}
else if (h > 12)
cout << h - 12 << endl;
else
cout << h + 12 << endl;
}
//  fclose(stdin);
//  fclose(stdout);
return 0;
}