-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtempCodeRunnerFile.cpp
More file actions
61 lines (57 loc) · 1.33 KB
/
tempCodeRunnerFile.cpp
File metadata and controls
61 lines (57 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*____________________________________________________
|Author: Ki6ui-Par1na
|Date: 2024/05/16
|Time: 01:18:35
|Problem: Time_Conversion
|____________________________________________________*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define print(n) cout << (n) << endl;
#define tc ll t; cin >> t; while(t--)
void solve() {
string s; cin >> s;
int len = s.length();
if(s[len - 2] == 'A'){
string ss; ss += s[0], ss += s[1];
int n = stoi(ss);
ss = to_string(n);
if(n == 12){
s[0] = '0', s[1] = '0';
}
if(ss.length() == 1){
s[0] = '0', s[1] = ss[0];
}
else{
s[0] = ss[0], s[1] = ss[1];
}
}
else{
if(s[0] == '1' and s[1] == '2');
else{
string ss; ss += s[0], ss += s[1];
int n = stoi(ss);
n += 12;
ss = to_string(n);
if(ss.length() == 1){
s[0] = '0', s[1] = ss[0];
}
else{
s[0] = ss[0], s[1] = ss[1];
}
}
}
for(int i = 0; i < len - 2; i++){
cout << s[i];
}
cout << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
solve();
return 0;
}