結果

問題 No.32 貯金箱の憂鬱
ユーザー howakurohowakuro
提出日時 2015-09-25 00:30:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 866 bytes
コンパイル時間 3,978 ms
コンパイル使用メモリ 73,916 KB
実行使用メモリ 59,136 KB
最終ジャッジ日時 2023-09-26 14:55:24
合計ジャッジ時間 7,118 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class MoneyBox {
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] args) {
		System.out.println("100円硬貨の枚数を指定してください");
		int L =scan.nextInt()*100;
		System.out.println("25円硬貨の枚数を指定してください");
		int M =scan.nextInt()*25;
		System.out.println("1円硬貨の枚数を指定してください");
		int N =scan.nextInt()*1;
		
		int Total = L+M+N;
		
		int Thousand = Total/1000;
		System.out.println(Thousand);
		Total -= Thousand*1000;
		
		int Handred = Total/100;
		Total -=Handred*100;
		
		int TowentyFive = Total/25;
		Total -= TowentyFive*25;
		
		int one = Total;
		System.out.println("1000円札紙幣が"+Thousand+"枚。100円硬貨が"+Handred+"枚。25円硬貨が"+TowentyFive+"枚。1円硬貨が"+one+"枚。");
		
		
		
		
	}

}
0