본문 바로가기
코딩테스트 준비/백준

[백준] 31610번 - 飴の袋詰め (Drops Packing) [Java]

by mwzz6 2025. 2. 19.

https://www.acmicpc.net/problem/31610

 

[백준] 31610번 - 飴の袋詰め (Drops Packing) [Java]
[백준] 31610번 - 飴の袋詰め (Drops Packing) [Java]


1.  아이디어

 

A * B + C의 값을 구하는 문제로 사칙연산 연산자로 간단하게 해결할 수 있다.


2. 문제풀이

 

System.out.println 메서드로 출력하는 방식으로 구현했다.


3. 코드

 

import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int A = Integer.parseInt(br.readLine());
        int B = Integer.parseInt(br.readLine());
        int C = Integer.parseInt(br.readLine());

        System.out.println(A * B + C);
    }
}

4. 후기