Advertisement
powerofsoul

Untitled

Dec 31st, 2015
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <cmath>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <iostream>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10.    int a,b,c;
  11.     char m;
  12.     string n;
  13.     cin>>a>>m>>b>>m>>c;
  14.    cin>>n;
  15.     if(n[0] == 'A')
  16.         {if(a<10)
  17.             cout<<"0"<<a<<":";
  18.          else if(a==12)
  19.              cout<<"00"<<":";
  20.          else
  21.              cout<<a<<":";
  22.    if(b<10)
  23.             cout<<0<<b<<":";
  24.          else
  25.              cout<<b<<":";
  26.          if(c<10)
  27.             cout<<0<<c;
  28.          else
  29.              cout<<c;
  30.         }
  31.     else
  32.         {
  33.         if(a<12)
  34.              cout<<a+12<<":";
  35.         else
  36.             cout<<"12"<<":";
  37.    if(b<10)
  38.             cout<<0<<b<<":";
  39.          else
  40.              cout<<b<<":";
  41.          if(c<10)
  42.             cout<<0<<c;
  43.          else
  44.              cout<<c;
  45.         }
  46.        
  47.        
  48.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement