๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
SWEA

[SWEA] 2043. ์„œ๋ž์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ

by JulesJ 2022. 5. 18.
728x90

2043. ์„œ๋ž์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ - D1

 

K ์ˆ˜๋ถ€ํ„ฐ 1์”ฉ ์ฆ๊ฐ€ํ•ด๋ณด๋ฉฐ password๋ฅผ ๋งž์ถ”๋Š” ๋ฌธ์ œ์ด๋‹ค.

๋”ฐ๋ผ์„œ ์ž…๋ ฅ๋ฐ›์€ password์—์„œ K๋งŒํผ ๋นผ์ฃผ๊ณ  1์„ ๋”ํ•œ๋‹ค.

 

 

import java.util.Scanner;
import java.io.FileInputStream;

class Solution
{
	public static void main(String args[]) throws Exception
	{

		Scanner sc = new Scanner(System.in);
		int password =sc.nextInt();
		int K = sc.nextInt();
        
		System.out.println(password - K + 1);

	}
}

 

 

๋ ๐Ÿง

๋Œ“๊ธ€