結果

問題 No.32 貯金箱の憂鬱
ユーザー Navi092itt
提出日時 2017-10-17 15:42:48
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 559 bytes
コンパイル時間 3,407 ms
コンパイル使用メモリ 75,576 KB
実行使用メモリ 54,264 KB
最終ジャッジ日時 2024-07-23 06:46:12
合計ジャッジ時間 5,467 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class testC {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        //ここから処理開始

        int L = sc.nextInt();  //100yen
        int M = sc.nextInt();  //25yen
        int N = sc.nextInt();  //1yen

        while (N >= 25) {
            M++; N -= 25;
        }

        while (M >= 4) {
            L++; M -= 4;
        }

        while (L >= 10) {
            L-=10;
        }

        System.out.println(L + M + N);

        //ここまで
        sc.close();
    }
}
0