結果

問題 No.525 二度寝の季節
ユーザー focus
提出日時 2018-01-15 19:34:50
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 552 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 56,180 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 03:16:06
合計ジャッジ時間 1,548 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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",&A,&B);
      |     ~~~~~^~~~~~~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
using namespace std;
int main(){
    int A,B;
    scanf("%d:%d",&A,&B);
    B+=5;
    if(B>=60){
        B-=60;
        A++;
    }
    if(A>23){
        A=0;
    }
    if(B>=10){
        if(A>=10){
            cout << A << ':' << B;
        }
        else{
            cout << '0' << A << ':' << B; 
        }
    }
    else{
        if(A>=10){
            cout << A << ":0" << B;
        }
        else{
            cout << '0' << A << ":0" << B; 
        }
    }
    return 0;
}

0