結果
問題 |
No.32 貯金箱の憂鬱
|
ユーザー |
![]() |
提出日時 | 2025-03-07 13:11:12 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 640 bytes |
コンパイル時間 | 751 ms |
コンパイル使用メモリ | 25,472 KB |
実行使用メモリ | 8,608 KB |
最終ジャッジ日時 | 2025-03-07 13:11:14 |
合計ジャッジ時間 | 1,846 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 11 |
ソースコード
#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 coin = 0; while( remainingMoney >= 100 ){ remainingMoney -= 100; coin++; } while( remainingMoney >= 25 ){ remainingMoney -= 25; coin++; } printf("%d\n",coin+remainingMoney); }