| ||||||||||
| 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 | |||||||||
哎,大家注意+12用24取模的时候,12这个数啊,代码如下,提交三次才通过#include<stdio.h>
int main(void)
{
// freopen("in.txt","r",stdin);
int n, hour, minute, stimes;
char c;
scanf("%d", &n);
while(n--){
scanf("%d%c%d", &hour, &c, &minute);
if(minute!=0)
stimes = 0;
else if(hour==12)
stimes = 24;
else
stimes = (hour+12)%24;
printf("%d\n", stimes);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator