結果

問題 No.525 二度寝の季節
ユーザー NoiriNoiri
提出日時 2017-12-05 12:59:53
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 765 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 53,060 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-19 03:21:58
合計ジャッジ時間 1,922 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main(){
    string t; cin >> t;
    string temp;
    string h;
    string m;

    //まずは:を除いたstring型を成形
    temp = t[0];
    h = temp;
    temp = t[1];
    h += temp;

    temp = t[3];
    m = temp;
    temp = t[4];
    m += temp;

    //整数に変換
    int min, hour;
    min = stoi(m);
    hour = stoi(h);

    min += 5;
    if(min >= 60){
        min = min-60;
        hour += 1;
        if(hour >= 24){
            hour = 0;
        }
    }

    if(min < 10 && hour < 10) cout << "0" << hour << ":" << "0" << min << endl;
    else if(min < 10) cout << hour << "0" << ":" << min << endl;
    else if(hour < 10) cout << "0" << hour << ":" << min << endl;

    return 0;
}
0