자바/백준

[백준 8370] Plane

슈슈버거 2022. 8. 16. 01:24

문제

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

 

8370번: Plane

In the first and only line of the standard input there are four integers n1, k1, n2 and k2 (1 ≤ n1, k1, n2, k2 ≤ 1 000), separated by single spaces.

www.acmicpc.net


내가 작성한 코드

import java.io.*;
import java.util.*;

public class 백준8370 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

        StringTokenizer st = new StringTokenizer(br.readLine());

        int n1 = Integer.parseInt(st.nextToken());
        int k1 = Integer.parseInt(st.nextToken());
        int n2 = Integer.parseInt(st.nextToken());
        int k2 = Integer.parseInt(st.nextToken());

        bw.write(Integer.toString((n1*k1)+(n2*k2)));
        bw.close();
    }
}