개발자 뺚
[BAEKJOON ONLINE JUDGE] 26575번 : Pups 본문
시간 제한 : 1 초
메모리 제한 : 1024 MB
문제
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 food that you will need to buy. You also know how much food costs per pound, so you just need to make sure that you bring the right amount of money to pay for the food. Write a program that, given the number of puppies, the amount of food per puppy, and the price per pound of food, calculates the amount of money that you will need to bring.
입력
The first line will contain a single integer n that indicates the number of lines that follow. Each line will contain three non-negative numbers d, f, and p for the number of dogs, the amount of food per dog in pounds, and the price of the food per pound.
출력
For each data set, output the total amount of money required to buy the food, rounded to the nearest hundredth. Include a dollar sign before the number.
coden = int(input())
for _ in range(n):
d, f, p = map(float, input().split(" "))
print("${:.2f}".format(d * f * p))
'Solution > Python' 카테고리의 다른 글
[BAEKJOON ONLINE JUDGE] 30214번 : An Easy-Peasy Problem (0) | 2024.03.19 |
---|---|
[BAEKJOON ONLINE JUDGE] 1032번 : 명령 프롬프트 (0) | 2024.03.17 |
[BAEKJOON ONLINE JUDGE] 28113번 : 정보섬의 대중교통 (0) | 2024.03.13 |
[BAEKJOON ONLINE JUDGE] 27959번 : 초코바 (0) | 2024.03.11 |
[BAEKJOON ONLINE JUDGE] 15964번 : 이상한 기호 (0) | 2024.03.09 |