結果

問題 No.32 貯金箱の憂鬱
ユーザー streingmuststreingmust
提出日時 2017-08-08 11:47:12
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 255 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 05:09:45
合計ジャッジ時間 2,431 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
    5 |         scanf("%d%d%d", L, M, N);
      |                ~^       ~
      |                 |       |
      |                 int *   int
main.c:5:19: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘int’ [-Wformat=]
    5 |         scanf("%d%d%d", L, M, N);
      |                  ~^        ~
      |                   |        |
      |                   int *    int
main.c:5:21: warning: format ‘%d’ expects argument of type ‘int *’, but argument 4 has type ‘int’ [-Wformat=]
    5 |         scanf("%d%d%d", L, M, N);
      |                    ~^         ~
      |                     |         |
      |                     int *     int
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d%d%d", L, M, N);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
	int L, M, N;
	scanf("%d%d%d", L, M, N);
	int a = L /25;
	if(a > 0){
		L -= a * 25;
		M += a;
	}
	a = M / 4;
	if(a > 0){
		M -= a * 4;
		N += a;
	}
	a = N / 10;
	if(a > 0) N -= a * 10;
	printf("%d", L + M + N);
	return 0;
}
0