SWEA 6692 다솔이의 월급 상자

1 개요[ | ]

SWEA 6692 다솔이의 월급 상자
SW Expert 아카데미
# 문제 풀이

틀:SWEA 난이도 3-1

2 C++[ | ]

3 Java[ | ]

import java.util.*;
public class Solution {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int TT, tt;
        TT = sc.nextInt();
        
        int N, i, x;
        float sum, p;
        for(tt=1; tt<=TT; tt++) {
            N = sc.nextInt();
            sum = 0;
            for(i=0; i<N; i++) {
                p = sc.nextFloat();
                x = sc.nextInt();
                sum += p*x;
            }
            System.out.format("#%d %f\n",tt,sum);
        }
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}