Deep_Dev

๋ฌธ์ œ ๋งํฌ

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QSEhaA5sDFAUq 

 

SW Expert Academy

SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!

swexpertacademy.com

 

 

 

 

import java.util.Scanner;
import java.io.FileInputStream;
class Solution
{
    public static void main(String args[]) throws Exception
    {
         Scanner kb=new Scanner(System.in);
        int T=kb.nextInt();
        int[][] arr=new int[T][10];
        for(int i=0; i<T; i++){
            for(int j=0; j<10; j++){
                arr[i][j]=kb.nextInt();
            }
        }
        int[] sum=new int[T];
        for(int i=0; i<T; i++){
            for(int j=0; j<10; j++){
                if(arr[i][j]%2!=0)
                    sum[i]+=arr[i][j];
            }
        }
        for(int i=0; i<T; i++){
            System.out.println("#"+(i+1)+" "+sum[i]);
        }
    }
}