[백준/Java] 2338 : 긴자리 계산

SEOP·2024년 1월 24일
0
post-custom-banner

import java.io.*;
import java.math.BigInteger;

public class Main {
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new BufferedReader(new InputStreamReader(System.in)));
        BufferedWriter bw = new BufferedWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        BigInteger firstInputLine = new BigInteger(br.readLine());
        BigInteger secondInputLine = new BigInteger(br.readLine());

        String firstOutputLine = String.valueOf(firstInputLine.add(secondInputLine));
        String secondOutputLine = String.valueOf(firstInputLine.subtract(secondInputLine));
        String thirdOutputLine = String.valueOf(firstInputLine.multiply(secondInputLine));

        bw.write(firstOutputLine);
        bw.newLine();
        bw.write(secondOutputLine);
        bw.newLine();
        bw.write(thirdOutputLine);
        bw.flush();
        bw.close();
    }
}
profile
응애 나 애기 개발자
post-custom-banner

0개의 댓글