백준 #27880번 Gahui and Soongsil University station

jhj·2024년 2월 17일

백준 JAVA

목록 보기
368/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int total = 0;
		
		for(int i = 0; i < 4; i++) {
			String a = sc.next();
			int b = sc.nextInt();
			if(a.equals("Es")) {
				total += b * 21;
			}else if(a.equals("Stair")) {
				total += b * 17;
			}
		}
		System.out.println(total);
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글