[백준/Java] 18108 : 1998년생인 내가 태국에서는 2541년생?!

SEOP·2023년 4월 24일
0

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a;
        int b = 543;
        a = scanner.nextInt();
        int result = a - b;
        System.out.println(result);
    }
}

OR

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());
        String result = String.valueOf(a-543);

        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        bw.write(result);
        bw.flush();
        bw.close();
    }
}
profile
응애 나 애기 개발자

0개의 댓글