본문 바로가기
Beakjoon&프로그래머스/Java

[백준/Java] 20254번 Site Score

by 현장 2022. 4. 14.

-Code

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] score = {56, 24, 14, 6};
        int answer = 0;

        for (int i = 0; i < 4; i++){
            int cnt = scanner.nextInt();
            answer += cnt * score[i];
        }

        System.out.println(answer);
    }
}