-
[브론즈 Ⅴ] 26575번 :: Pups / Java백준/브론즈 2023. 2. 23. 22:15
문제
https://www.acmicpc.net/problem/26575
26575번: Pups
Congratulations, you adopted some little puppies! Now you just need to go grab food for them at the store. Your vet tells you how many pounds of food each pup will eat before your next trip to the store, so you just need to calculate the total amount of fo
www.acmicpc.net
코드
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 n = Integer.parseInt(br.readLine()); StringTokenizer st; for(int i=0; i<n; i++) { st = new StringTokenizer(br.readLine()); Double d = Double.parseDouble(st.nextToken()); Double f = Double.parseDouble(st.nextToken()); Double p = Double.parseDouble(st.nextToken()); System.out.printf("$%.2f\n", d*f*p); } } }
'백준 > 브론즈' 카테고리의 다른 글
[브론즈 Ⅴ] 27294번 :: 몇개고? / Java (0) 2023.02.24 [브론즈 Ⅴ] 26209번 :: Intercepting Information / Java (0) 2023.02.23 [브론즈 Ⅴ] 26082번 :: WARBOY / Java (0) 2023.02.23 [브론즈 Ⅴ] 25372번 :: 성택이의 은밀한 비밀번호 / Java (0) 2023.02.23 [브론즈 Ⅴ] 25304번 :: 영수증 / Java (0) 2023.02.23