結果

問題 No.32 貯金箱の憂鬱
ユーザー Maeda
提出日時 2025-03-07 13:15:44
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 790 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 25,472 KB
実行使用メモリ 8,608 KB
最終ジャッジ日時 2025-03-07 13:15:46
合計ジャッジ時間 785 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

void main(void){
	int l = 0 , m = 0 , n = 0 ;
	
	int input =  scanf("%d",&l);
	if(input == 2){
		printf("Lの入力ミス\n");
	}
	int total = 100*l;
	
	input =  scanf("%d",&m);
	if(input == 2){
		printf("Mの入力ミス\n");
	}
	total += m*25;
	
	input =  scanf("%d",&n);
	if(input == 2){
		printf("Nの入力ミス\n");
	}
	total += 1*n;
	int thousandYenBill = total / 1000;
	int remainingMoney = total - thousandYenBill;
	
	int coinL = 0;
	int coin = 0;
	while( remainingMoney >= 100 ){
		remainingMoney -= 100;
		coin++;
		coinL++;
	}
	int coinM = 0;
	while( remainingMoney >= 25 ){
		remainingMoney -= 25;
		coin++;
		coinM++;
	}
	printf("100円硬貨:%d 25円硬貨:%d 1円硬貨:%d\n",coinL,coinM,remainingMoney);
	printf("%d\n",coin+remainingMoney);
}
0