백준 #28249번 Chili Peppers

jhj·2024년 2월 17일

백준 JAVA

목록 보기
359/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int total = 0;
		
		for(int i = 0; i < n; i++) {
			String a = sc.next();
			if(a.equals("Poblano")) {
				total += 1500;
			}else if(a.equals("Mirasol")) {
				total += 6000;
			}else if(a.equals("Serrano")) {
				total += 15500;
			}else if(a.equals("Cayenne")) {
				total += 40000;
			}else if(a.equals("Thai")) {
				total += 75000;
			}else if(a.equals("Habanero")) {
				total += 125000;
			}
		}
		System.out.println(total);
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글