https://www.acmicpc.net/problem/5361
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
StringBuilder sb = new StringBuilder();
for (int i = 0; i < T; i++) {
StringTokenizer st = new StringTokenizer(br.readLine());
double a = Double.parseDouble(st.nextToken());
double b = Double.parseDouble(st.nextToken());
double c = Double.parseDouble(st.nextToken());
double d = Double.parseDouble(st.nextToken());
double e = Double.parseDouble(st.nextToken());
double sum = 350.34 * a + 230.90 * b + 190.55 * c + 125.30 * d + 180.90 * e;
System.out.printf("$%.2f\n", sum);
}
}
}
'알고리즘 > 백준' 카테고리의 다른 글
백준 2783 삼각김밥 (0) | 2022.12.07 |
---|---|
백준 14656 조교는 새디스트야!! (0) | 2022.12.06 |
백준 10409 서버 (0) | 2022.12.06 |
백준 11006 남욱이의 닭장 (0) | 2022.12.06 |
백준 13752 히스토그램 (0) | 2022.12.06 |