| ||||||||||
| 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 | |||||||||
很短的代码#include<stdio.h>
main()
{
int t,a,b,c,d,e,f;
scanf("%d",&t);
while(t--)
{
scanf("%d/%d/%d-%d:%d:%d",&a,&b,&c,&d,&e,&f);
printf("%02d/%02d/%d-%02d:%02d:%02d%s\n",b,c,a,(d+11)%12+1,e,f,d<12?"am":"pm"); //%02d的意思是输出两位,不足两位前面补0
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator