Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <cstdio>
- #include <vector>
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main() {
- int a,b,c;
- char m;
- string n;
- cin>>a>>m>>b>>m>>c;
- cin>>n;
- if(n[0] == 'A')
- {if(a<10)
- cout<<"0"<<a<<":";
- else if(a==12)
- cout<<"00"<<":";
- else
- cout<<a<<":";
- if(b<10)
- cout<<0<<b<<":";
- else
- cout<<b<<":";
- if(c<10)
- cout<<0<<c;
- else
- cout<<c;
- }
- else
- {
- if(a<12)
- cout<<a+12<<":";
- else
- cout<<"12"<<":";
- if(b<10)
- cout<<0<<b<<":";
- else
- cout<<b<<":";
- if(c<10)
- cout<<0<<c;
- else
- cout<<c;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement