์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ/BOJ_Java

[BOJ/Step2] 1330 : ๋‘ ์ˆ˜ ๋น„๊ตํ•˜๊ธฐ (JAVA)

NaNaRin๐Ÿ™ƒ 2021. 1. 6. 17:49

www.acmicpc.net/problem/1330

 

1330๋ฒˆ: ๋‘ ์ˆ˜ ๋น„๊ตํ•˜๊ธฐ

๋‘ ์ •์ˆ˜ A์™€ B๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ, A์™€ B๋ฅผ ๋น„๊ตํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

www.acmicpc.net


๋ฌธ์ œ

๋‘ ์ •์ˆ˜ A์™€ B๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ, A์™€ B๋ฅผ ๋น„๊ตํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

 

์ž…๋ ฅ

์ฒซ์งธ ์ค„์— A์™€ B๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. A์™€ B๋Š” ๊ณต๋ฐฑ ํ•œ ์นธ์œผ๋กœ ๊ตฌ๋ถ„๋˜์–ด์ ธ ์žˆ๋‹ค.

 

์ถœ๋ ฅ

์ฒซ์งธ ์ค„์— ๋‹ค์Œ ์„ธ ๊ฐ€์ง€ ์ค‘ ํ•˜๋‚˜๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.

- A๊ฐ€ B๋ณด๋‹ค ํฐ ๊ฒฝ์šฐ์—๋Š” '>'๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.

- A๊ฐ€ B๋ณด๋‹ค ์ž‘์€ ๊ฒฝ์šฐ์—๋Š” '<'๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.

- A์™€ B๊ฐ€ ๊ฐ™์€ ๊ฒฝ์šฐ์—๋Š” '=='๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.

 

์ œํ•œ

10,000 ≤ A, B ≤ 10,000

 

์˜ˆ์ œ ์ž…๋ ฅ 1

1 2

 

์˜ˆ์ œ ์ถœ๋ ฅ 1

<

 

์˜ˆ์ œ ์ž…๋ ฅ 2

10 2

 

์˜ˆ์ œ ์ถœ๋ ฅ 2

>

 

์˜ˆ์ œ ์ž…๋ ฅ 3

5 5

 

์˜ˆ์ œ ์ถœ๋ ฅ 3

==


ํ’€์ด

 

import java.util.Scanner;

public class B1330 {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();	
		
		if (a > b) {
			System.out.println(">");
		} else if (a < b) {
			System.out.println("<");
		} else if (a == b) {
			System.out.println("==");
		} 
	}
}