Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int h,m,s;
- char str[2];
- scanf("%d%d%d",&h,&m,&s);
- gets(str);
- if(str[1]=='P'){
- h+=12;
- printf("%d:%d:%d\n",h,m,s);
- }
- else
- {
- if(h==12){
- h=0;
- }
- if(h<10)
- printf("0%d:0%d:%d\n",h,m,s);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement