You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the vidéo here : https://youtu.be/G7bia__Vxqg
int main() { string s; cin >> s; int h; sscanf(s.c_str(), "%d", &h); if(s[8] == 'A' && h == 12) h = 0; if(s[8] == 'P' && h != 12) h+=12; cout << setw(2) << setfill('0') << h; cout << s.substr(2, 6); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the vidéo here : https://youtu.be/G7bia__Vxqg