Subscribed unsubscribe Subscribe Subscribe

yukicoder No.32 貯金箱の憂鬱

Problem

No.32 貯金箱の憂鬱 - yukicoder

Solution

Code

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int L = Integer.parseInt(reader.readLine());
        int M = Integer.parseInt(reader.readLine());
        int N = Integer.parseInt(reader.readLine());

        M += N / 25;
        N = N - 25 * (N / 25);
        L += M / 4;
        M = M - 4 * (M / 4);
        int tmp = L / 10;
        L = L - 10*tmp;
        System.out.println(N + M + L);

    }
}
Remove all ads