Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 7708 | Accepted: 3600 |
Description
Input
Output
Sample Input
2 2009/11/07-12:12:12 1970/01/01-00:01:01
Sample Output
11/07/2009-12:12:12pm 01/01/1970-12:01:01am
Hint
Source
/* *Copyright (c)2015,烟台大学计算机与控制工程学院 *All rights reserved. *作 者:单昕昕 *完成日期:2015年8月16日 *版 本 号:v1.0 */ #include<stdio.h> #include<stdlib.h> #include <iostream> using namespace std; int main() { int t,year,month,day,hour,minute,second,h; char c1,c2,c3,c4,c5; cin>>t; while(t--) { cin>>year>>c1>>month>>c2>>day>>c3>>hour>>c4>>minute>>c5>>second; if(hour==0) h=12; else h=(hour>12?hour-12:hour); printf("%02d%c%02d%c%d%c%02d%c%02d%c%02d",month,c1,day,c2,year,c3,h,c4,minute,c5,second); cout<<(hour>=12?"pm":"am")<<endl; } return 0; }