Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- Docker
- 자연어처리
- gs25
- Real or Not? NLP with Disaster Tweets
- 프로그래머스 파이썬
- 금융문자분석경진대회
- programmers
- 데이콘
- PYTHON
- ubuntu
- 더현대서울 맛집
- Git
- 우분투
- AI 경진대회
- 맥북
- ChatGPT
- dacon
- leetcode
- 편스토랑 우승상품
- Kaggle
- github
- 캐치카페
- 백준
- 코로나19
- 편스토랑
- SW Expert Academy
- hackerrank
- 파이썬
- Baekjoon
- 프로그래머스
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 4714번 : Lunacy (Python) 본문
728x90
반응형
코딩 1일 1문제! 오늘의 문제는 백준의 Lunacy 입니다.
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 )
def lunacy(weight):
lunacy_weight = round(weight * 0.167, 2)
return lunacy_weight
def convert_weight_to_answer_format(weight):
return "%.2f"%weight
def convert_str_to_answer_format(weight, lunacy_weight):
return f"Objects weighing {weight} on Earth will weigh {lunacy_weight} on the moon."
if __name__ == "__main__":
while True:
weight = float(input())
if weight == -1.0:
break
lunacy_weight = lunacy(weight=weight)
weight = convert_weight_to_answer_format(weight=weight)
lunacy_weight = convert_weight_to_answer_format(weight=lunacy_weight)
print(convert_str_to_answer_format(weight=weight, lunacy_weight=lunacy_weight))
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 23825번 : SASA 모형을 만들어보자 (Python) (0) | 2022.08.29 |
---|---|
[BaekJoon] 2999번 : 비밀 이메일 (Python) (0) | 2022.08.25 |
[BaekJoon] 6778번 : Which Alien? (Python) (0) | 2022.08.23 |
[BaekJoon] 11784번 : Hex Code (Python) (0) | 2022.08.22 |
[BaekJoon] 15792번 : A/B - 2 (Python) (0) | 2022.08.21 |
Comments