본문 바로가기
코딩테스트 문제집/Softeer(Lv1): FIN

[Softeer] Lv1: 주행거리 비교하기(6253)

by cogito30 2025. 2. 7.
반응형

문제

- 링크: https://softeer.ai/practice/6253

 

풀이

더보기
import java.io.*;
import java.util.*;

public class Main {

    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("A");
        } else if (a < b) {
            System.out.println("B");
        } else {
            System.out.println("same");
        }
    }
}

 

반응형