結果

問題 No.525 二度寝の季節
ユーザー fumi6328
提出日時 2018-09-10 21:18:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 344 bytes
コンパイル時間 808 ms
コンパイル使用メモリ 54,264 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-31 22:34:20
合計ジャッジ時間 1,985 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d:%d",&h,&m);
      |     ~~~~~^~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
    int h,m;
    scanf("%d:%d",&h,&m);
    
    m += 5;
    if(m > 59){
        h++;
        m %= 60;
    }
    if(h > 23) h = 0;

    if(h < 10) cout << '0';
    cout << h << ':';
    if(m < 10) cout << '0';
    cout << m << endl;

    return 0;
}
0