문제
문제 풀이
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
//(1)
if(a>b){
System.out.println(">");
}
//(2)
if(a<b){
System.out.println("<");
}
//(3)
if(a==b){
System.out.println("==");
}
//(4)
}
}
- a, b 두 수를 입력합니다.
- a > b 일 시 ">"를 출력합니다.
- a < b 일 시 "<"를 출력합니다.
- a == b 일 시 "=="를 출력합니다.
결과
'Algorithm > 백준' 카테고리의 다른 글
[백준] 2338번: 긴자리 계산 - JAVA [자바] (0) | 2023.04.17 |
---|---|
[백준] 1809번: Moo - JAVA [자바] (0) | 2023.04.17 |
[백준] 1271번: 엄청난 부자2 - JAVA [자바] (1) | 2023.04.17 |
[백준] 1008번: A/B - JAVA [자바] (0) | 2023.04.17 |
[백준] 1001번: A-B - JAVA [자바] (0) | 2023.04.17 |