Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t;
- scanf("%d", &t);
- int i=0;
- for(i=1;i<=t;i++){
- int h, m;
- scanf("%d:%d", &h,&m);
- if(h==0){
- printf("Case %d: 12:%02d AM\n", i,m);
- }
- else if(h<=11){
- printf("Case %d: %d:%02d AM\n", i,h,m);
- }
- else if(h==12){
- printf("Case %d: %d:%02d PM\n", i,h,m);
- }
- else{
- printf("Case %d: %d:%02d PM\n", i,h-12,m);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement