| ||||||||||
| 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 | |||||||||
没想法了 只要分钟不为0,就要输出0附代码
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
int a,b;
scanf("%d:%d",&a,&b);
if (b)
{
printf("0\n");
continue;
}
if(a>12&&a<24)
printf("%d\n",a-12);
else if(a>=0&&a<=12)
printf("%d\n",a+12);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator