結果

問題 No.296 n度寝
ユーザー じゃがりこ
提出日時 2018-09-10 22:11:16
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 25,088 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 18:42:48
合計ジャッジ時間 1,000 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%d%d%d%d", &N, &H, &M, &T);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
   int N, H, M, T,i;

    scanf("%d%d%d%d", &N, &H, &M, &T);
    for(int i = 1; i < N; i++){
    	M = M + T;
    	if (M >= 60) {
    		H++;
    		M = M + T - 60;
    	}
    	if (H >= 23) {
    		H == 0;
    	}
    }
    printf("%d\n%d\n", H, M);

}
0