๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Algorithm/๋ฐฑ์ค€ ์•Œ๊ณ ๋ฆฌ์ฆ˜

[๋ฐฑ์ค€ ์•Œ๊ณ ๋ฆฌ์ฆ˜] 1330๋ฒˆ - ๋‘ ์ˆ˜ ๋น„๊ตํ•˜๊ธฐ

by ์ฝ”๋”ฉํ•˜๋Š” ๋ถ•์–ด 2021. 1. 31.
๋ฐ˜์‘ํ˜•

2. if๋ฌธ - ๋‘ ์ˆ˜ ๋น„๊ตํ•˜๊ธฐ

 

 

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

์ž…๋ ฅ ์ถœ๋ ฅ
1  2 <

 

์ž…๋ ฅ ์ถœ๋ ฅ
10  2 >

 

์ž…๋ ฅ ์ถœ๋ ฅ
5  5 ==

 

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a, b;
		a = sc.nextInt();
		b = sc.nextInt();
		if (a > b)
			System.out.println(">");
		if (a < b)
			System.out.println("<");
		if (a == b)
			System.out.println("==");
	}
}
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€