꾸준히 합시다
백준 파이썬 4714번: Lunacy 본문
https://www.acmicpc.net/problem/4714
4714번: Lunacy
After several months struggling with a diet, Jack has become obsessed with the idea of weighing less. In an odd way, he finds it very comforting to think that, if he had simply had the luck to be born on a different planet, his weight could be considerably
www.acmicpc.net
문제 유형: 수학, 사칙연산
# Solution 1
while True:
weight = float(input())
if weight == -1.0:
break
print("Objects weighing %.2f on Earth will weigh %.2f on the moon." % (weight, weight * 0.167))
인풋으로 주어진 지구에서의 무게에 0.167를 곱해 달에서의 무게로 변환하면 되는 단순 구현 문제.
하나 염두해야 할 점은 소수점 두 자리까지만 출력해야 한다는 것이다.
'코딩 테스트 문제 풀이' 카테고리의 다른 글
백준 파이썬 16337번: Die (0) | 2021.06.13 |
---|---|
백준 파이썬 3486번: Adding Reversed Numbers (0) | 2021.06.12 |
백준 파이썬 9094번: 수학적 호기심 (0) | 2021.04.15 |
백준 파이썬 4504번: 배수 찾기 (0) | 2021.04.14 |
백준 파이썬 10872번: 팩토리얼 (0) | 2021.04.13 |
Comments