// No.525 二度寝の季節 // https://yukicoder.me/problems/no/525 // #include #include #include #include #include using namespace std; vector split_input(); int main() { vector res = split_input(); int hh, mm; hh = stoi(res[0]); mm = stoi(res[1]); mm += 5; if (mm >= 60) { mm -= 60; hh++; if (hh >= 24) { hh -= 24; } } cout << setw(2) << setfill('0') << hh << ":"; cout << setw(2) << setfill('0') << mm << endl; } vector split_input() { // 1行で入力された:文字区切りのデータを分割しその結果を返す。 vector res; string input_txt; getline(cin, input_txt); regex rx(R"(:)"); sregex_token_iterator it(input_txt.begin(), input_txt.end(), rx, -1); sregex_token_iterator end; while (it != end) { if (*it != "") res.push_back(*it++); else it++; } return res; }