백준 #33191번 Yalda

jhj·2025년 5월 8일

백준 JAVA

목록 보기
574/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int m = sc.nextInt();
		
		int w = sc.nextInt();
		int p = sc.nextInt();
		int n = sc.nextInt();
		
		if(m >= w) {
			System.out.println("Watermelon");
		}else if(m >= p) {
			System.out.println("Pomegranates");
		}else if(m >= n) {
			System.out.println("Nuts");
		}else {
			System.out.println("Nothing");
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글