본문 바로가기
Coding Test/CodeUp

CodeUp_Java 기초 100제 - [기초-삼항연산] 두 정수 입력받아 큰 수 출력하기 63

by SeleniumBindingProtein 2022. 2. 13.
728x90
반응형

//자바코드
import java.util.Scanner;

public class Main{
	public static void main (String[] args){
    	Scanner sc = new Scanner(System.in);
		//System.out.print("정수 2개 입력 : ");
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();
       
        //a와 b를 비교한 후 참이면 a, 거짓이면 b를 출력 
        System.out.println(a>b?a:b);
    }
}
728x90
반응형

댓글