백준 #32278번 선택 가능성이 가장 높은 자료형

jhj·2025년 5월 8일

백준 JAVA

목록 보기
571/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		long num = sc.nextLong();
		
		if(-32768 <= num && num <= 32767) {
			System.out.println("short");
		}else if(-2147483648 <= num && num <= 2147483647) {
			System.out.println("int");
		}else {
			System.out.println("long long");
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글