2021.09.15 작성
이 전 게시글인 백준 1000번 문제와 똑같은 문제이다.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
/* 일반 입출력 */
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(a - b);
}
}
기본적으로 정수형 a, b 변수에 입력받아 두 수를 뺀 값을 출력
import java.io.*;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer st = new StringTokenizer(bf.readLine());
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
bw.write(String.valueOf(a-b));
bw.flush();
bw.close();
}
}
위에서 말했듯이 1000번 문제와 같으니 자세한 설명은 생략하고 혹시 설명을 보고 싶으신 분은 아래 주소를 참고하면 좋을 것 같다.
https://velog.io/@kongs_/%EB%B0%B1%EC%A4%80-1000%EB%B2%88-Java
제출 번호 33336834번 - 일반 입력
제출 번호 33336858번 - 빠른 입력