본문 바로가기

Algorithm/백준

[백준] 1001번: A-B - JAVA [자바]


 

문제


 

문제 풀이


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();
        //(1)
        System.out.println(A-B);
    	//(2)
    }

}

 

  1. A와 B를 입력 받습니다
  2. A와 B를 빼서 출력합니다.

결과