| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:继续水~~~~#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator