백준 #26530번 Shipping

jhj·2024년 2월 15일

백준 JAVA

목록 보기
328/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int t = sc.nextInt();
		for(int i = 0; i < t; i++) {
			int n = sc.nextInt();
			double total = 0;
			for(int j = 0; j < n; j++) {
				String name = sc.next();
				int count = sc.nextInt();
				double cost = sc.nextDouble();
				total += count * cost;
			}
			System.out.println("$" + String.format("%.2f", total));
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글