fork download
  1. #include<stdio.h>
  2. char s[10],m[3];
  3. int main(int H){
  4. if(scanf("%d:%s%s",&H,&s,&m)==3,printf("%d:%s",H+12*(m[0]=='P'),s)){}
  5. }
Success #stdin #stdout 0s 9432KB
stdin
10:20:15 PM
stdout
22:20:15