結果
問題 | No.32 貯金箱の憂鬱 |
ユーザー | clamd |
提出日時 | 2016-12-10 14:13:16 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 142 ms / 5,000 ms |
コード長 | 489 bytes |
コンパイル時間 | 3,387 ms |
コンパイル使用メモリ | 74,960 KB |
実行使用メモリ | 54,400 KB |
最終ジャッジ日時 | 2024-07-23 02:27:34 |
合計ジャッジ時間 | 5,684 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
import java.util.Scanner; public class changeMoney { public static void main(String[] args) { Scanner sn = new Scanner(System.in); int h = sn.nextInt(); int t = sn.nextInt(); int w = sn.nextInt(); int count; sn.close(); while (h >= 10 || t >= 4 || w >= 25) { if (w >= 25) { t += w / 25; w = w % 25; } else if (t >= 4) { h += t / 4; t = t % 4; } else if (h >= 10) { h = h % 10; } } count = h + t + w; System.out.println(count); } }