Baekjoon Algorithm | Problem 1330: Compare Two Numbers

Source

https://www.acmicpc.net/problem/1330

Problem

Solve Baekjoon Online Judge problem 1330, Compare Two Numbers.

Input

Follow the input format and constraints given in the original problem statement.

Output

Print the answer required by the problem.

Sample Input 1

1 2

Sample Output 1

<

Sample Input 2

10 2

Sample Output 2

\>

Sample Input 3

5 5

Sample Output 3

==

Algorithm Classification

  • Math
  • Implementation
  • Arithmetic

Solution

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String[] input = br.readLine().split(" ");

            int a = Integer.parseInt(input[0]);
            int b = Integer.parseInt(input[1]);

            String c;
            if (a > b)
                c = ">";
            else if (a < b)
                c = "<";
            else
                c = "==";

            System.out.print(c);
        }
    }
}