You are viewing a single comment's thread. Return to all comments →
string timeConversion(string s) { if(s[8]== 80){ if(s[0] == 49 && s[1] == 50){ s.pop_back(); s.pop_back(); return s; } string hour= ""; hour.push_back(s[0]); hour.push_back(s[1]); int date = stoi(hour) + 12; hour = to_string(date); s[0] = hour[0]; s[1] = hour[1]; s.pop_back(); s.pop_back(); return s; }else if(s[8] == 65 && s[0] == 49 && s[1] == 50){ s[0] = 48; s[1] = 48; s.pop_back(); s.pop_back(); return s; }else{ s.pop_back(); s.pop_back(); return s; } }
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 →
C++ Solution