hwangnk1004 / Algorithm

0 stars 0 forks source link

StepByStep #칼로리계산하기 #99

Open hwangnk1004 opened 4 years ago

hwangnk1004 commented 4 years ago

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);

    int[][] arr = new int[][] {{461,431,420,0}, {130,160,118,0}, {100,57,70,0},{167,266,75,0}};

    int sum = arr[0][scanner.nextInt()-1] + arr[1][scanner.nextInt()-1] + arr[2][scanner.nextInt()-1] +
            arr[3][scanner.nextInt()-1];

    System.out.println("Your total Calorie count is " +sum+".");

}

}

jaeho-lee104 commented 4 years ago

굿잡