공부하는 히욤이

2058.자릿수 더하기 본문

Algorithm/SW Expert Academy

2058.자릿수 더하기

히욤이 2019. 1. 10. 00:14

SW Expert 2058.자릿수 더하기

문제의 저작권은 SW Expert에 있습니다 



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;
 
public class Solution {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int p = scanner.nextInt(); //비밀번호
        int k = scanner.nextInt(); //주어지는 번호
        int answer = 0;
         
        if (p>=000 && p<=999) {
            answer = (p-k)+1;
             
        }
        System.out.println(answer);
    }
 
}
cs


'Algorithm > SW Expert Academy' 카테고리의 다른 글

2027. 대각선 출력하기  (0) 2019.01.10
1938. 아주 간단한 계산기  (0) 2019.01.10
2047. 신문 헤드라인  (0) 2019.01.10
1936. 1대1 가위바위보  (0) 2019.01.10
2046. 스탬프 찍기  (0) 2019.01.09