結果

問題 No.525 二度寝の季節
ユーザー shioya
提出日時 2018-07-21 13:23:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 304 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 53,884 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 04:48:03
合計ジャッジ時間 1,723 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d:%d", &a, &b);
      |         ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

//No.525 二度寝の季節
#include<iostream>
using namespace std;

int main()
{
	int a, b;
	scanf("%d:%d", &a, &b);
	b += 5;
	if (b >= 60) {
		b %= 60;
		a++;
	}
	if (a >= 24)a %= 24;

	cout.width(2);
	cout.fill('0');
	cout << a;
	cout << ':';
	cout.width(2);
	cout.fill('0');
	cout << b;
	return 0;
}
0