알고리즘 문제

[백준] 1330번 두 수 비교하기

feelcoding 2020. 1. 10. 16:51
728x90

단계별로 풀어보기 if문의 1단계 문제

 

1330번: 두 수 비교하기

두 정수 A와 B가 주어졌을 때, A와 B를 비교하는 프로그램을 작성하시오.

www.acmicpc.net

너무 쉬운 문제라서 올리기도 민망하지만

import java.util.Scanner;

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

728x90