백준 31403번

김경욱·2026년 1월 24일

백준

목록 보기
112/121

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

// Press Shift twice to open the Search Everywhere dialog and type show whitespaces,
// then press Enter. You can now see whitespace characters in your code.
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);
    String combined = String.valueOf(a) + String.valueOf(b);
    int combinedInt = Integer.parseInt(combined);
    System.out.println(combinedInt-c);



}

}

숫자를 문자열로 바꾸려면 String.valueOf(x)이다.

0개의 댓글