結果

問題 No.32 貯金箱の憂鬱
ユーザー ちよちゃん
提出日時 2016-05-11 11:46:13
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 858 bytes
コンパイル時間 3,389 ms
コンパイル使用メモリ 77,892 KB
実行使用メモリ 54,408 KB
最終ジャッジ日時 2024-10-05 13:41:24
合計ジャッジ時間 5,064 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yuki8 {
	
	public static void main(String[] args) {
		
		final int m_1000yen = 1000;
		final int m_100yen = 100;
		final int m_25yen = 25;
		final int m_1yen = 1;
		
		Scanner scan = new Scanner(System.in);
		int l = scan.nextInt();
		int m = scan.nextInt();
		int n = scan.nextInt();
		scan.close();
		
		int total = (m_100yen * l) + (m_25yen * m ) + (m_1yen * n);
		int count = 0;
		
		if (total % m_1000yen != 0) {
			//千円はカウントに含めない
			//count += (total / m_1000yen);
			total = (total % m_1000yen);
		}
		if (total % m_100yen != 0) {
			count += (total / m_100yen);
			total = (total % m_100yen);
		}
		if (total % m_1yen != 0) {
			count += (total / m_25yen);
			total = (total % m_25yen);
		}
		
		count += (total / m_1yen);
		total = (total % m_1yen);
	
		System.out.println(count);
	}
}
0