結果

問題 No.32 貯金箱の憂鬱
ユーザー clamd
提出日時 2016-12-10 14:00:13
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 3,691 ms
コンパイル使用メモリ 76,840 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-11-29 00:39:43
合計ジャッジ時間 6,141 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

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 = h + t + w;
		sn.close();

		while (h >= 10 || t >= 4 || w >= 25) {
			if (w >= 25) {
				w = w % 25;
				t += w / 25;
			} else if (t >= 4) {
				t = t % 4;
				h += t / 4;
			} else if (h >= 10) {
				h = h % 10;
			}
		}
		System.out.println(count);
	}
}
0