728x90
9317번: Monitor DPI
Each input line will have 3 numbers, the decimal value D, the integer value \(\text{Resolution}_{\text{Horizontal}}\), and the integer value \(\text{Resolution}_{\text{Vertical}}\). An input line of three zeroes will signify end of input
www.acmicpc.net
문제 풀이
입력값을 받고, 문제에 나오는 공식을 적용해 출력해주면 된다.
정답 코드
while True :
D, RH, RV = map(float, input().split())
if D == RH == RV == 0 : break
W = 16 * D / (337 ** 0.5)
H = 9 * W / 16
print("Horizontal DPI: {:.2f}".format(RH / W))
print("Vertical DPI: {:.2f}".format(RV / H))
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 9366 - 삼각형 분류 [python] (0) | 2023.03.24 |
---|---|
[BOJ/백준] 9325 - 얼마? [python] (0) | 2023.03.24 |
[BOJ/백준] 9310 - Arithmetic and Geometric Sums [python] (0) | 2023.03.24 |
[BOJ/백준] 9306 - Practice: Roll Call [python] (0) | 2023.03.24 |
[BOJ/백준] 9299 - Math Tutoring [python] (0) | 2023.03.24 |