Coding Test/백준(Python)
[백준/Python] 26575번(수학)_Pups
syunze
2023. 1. 31. 14:49
📌문제 유형
수학, 사칙연산(브론즈V)
📌문제
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
📌나의 문제풀이
n = int(input())
for i in range(n):
a, b, c = map(float,input().split())
print('$'+str(format(a*b*c,".2f")))
📌참조
- 소수점 2자리까지 만드는 방법
- round(num,2)
- format(num,".2f")
- '${0:.2f}'.format(num)
Python 소수점 자리수 지정(제한, 조절) 하는 방법 4가지
Python 소수점 자리수 지정(제한, 조절) 하는 방법 4가지 Python 에서 소수점 자리를 설정하는 4 가지 방법을 알려드리도록 하겠습니다. 목차 round() 함수를 사용하여 소수점 지정하는 방법 f-string 을
jsikim1.tistory.com
728x90