글 작성자: 취업중인 피터팬
728x90

https://www.acmicpc.net/problem/5522

 

5522번: 카드 게임

JOI군은 카드 게임을 하고 있다. 이 카드 게임은 5회의 게임으로 진행되며, 그 총점으로 승부를 하는 게임이다. JOI군의 각 게임의 득점을 나타내는 정수가 주어졌을 때, JOI군의 총점을 구하는 프

www.acmicpc.net

 

제한 서브 텍스트가 있어서 뭔지 했는지 문제 푸는데는 문제가 없어서 그냥 진행했습니다.

 

정답

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int one = sc.nextInt();
        int two = sc.nextInt();
        int three = sc.nextInt();
        int four = sc.nextInt();
        int five = sc.nextInt();
        
        System.out.println(one+two+three+four+five);
    }
}