알고리즘공부

[1단계]1001번 A-B

xxo_ohii 2022. 1. 10. 17:33
728x90

[문제]

두 정수 A와 B를 입력받은 다음, A-B를 출력하는 프로그램을 작성하시오.

 

 

 

 

[풀이]

import java.util.Scanner; //스캐너를 쓰기 위한 import문

public class Main {
    public static void main(String[] args) {
    	
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int AB = A-B;
        System.out.print(A+B);
    }
}
728x90