Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

很短的代码

Posted by 1008061011 at 2011-07-28 19:26:16 on Problem 3751
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator