문제 링크입니다: 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
간단한 구현 문제였습니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
const double MOON_WEIGHT_RATIO = 0.167; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
while (1) | |
{ | |
double weight; | |
cin >> weight; | |
if (weight < 0.00) | |
{ | |
break; | |
} | |
printf("Objects weighing %.2lf on Earth will weigh %.2lf on the moon.\n", weight, weight * MOON_WEIGHT_RATIO); | |
} | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 4766번 일반 화학 실험 (0) | 2021.05.16 |
---|---|
백준 4758번 Filling Out the Team (0) | 2021.05.16 |
백준 4690번 완전 세제곱 (0) | 2021.05.16 |
백준 4655번 Hangover (0) | 2021.05.16 |
백준 4635번 Speed Limit (0) | 2021.05.16 |