SWEA_2043) 서랍의 비밀번호
SWEA
# D1
2043) 서랍의 비밀번호 (19.10.01)
문제 링크 (SW Expert Academy)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer tk = new StringTokenizer(br.readLine());
int p = Integer.parseInt(tk.nextToken());
int k = Integer.parseInt(tk.nextToken());
int cnt = 1;
while(p!=k) {
cnt = cnt+1;
k = k+1;
}
bw.write(String.valueOf(cnt));
bw.flush();
bw.close();
}
}
| cs |
댓글
댓글 쓰기