문제 링크입니다: https://www.acmicpc.net/problem/4766
4766번: 일반 화학 실험
입력은 동혁이가 측정한 혼합물의 온도가 순서대로 주어진다. 온도는 -10도와 200도 사이이고, 소수점 둘째짜리까지 적혀져 있을 수도 있다. 마지막 측정 후에는 999가 주어진다. 동혁이는 온도를
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; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
double prevTemperature; | |
cin >> prevTemperature; | |
while (1) | |
{ | |
double curTemperature; | |
cin >> curTemperature; | |
if (curTemperature == 999) | |
{ | |
break; | |
} | |
printf("%.2lf\n", curTemperature - prevTemperature); | |
prevTemperature = curTemperature; | |
} | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 4890번 Tiles of Tetris, NOT! (0) | 2021.05.16 |
---|---|
백준 4880번 다음수 (0) | 2021.05.16 |
백준 4758번 Filling Out the Team (0) | 2021.05.16 |
백준 4714번 Lunacy (0) | 2021.05.16 |
백준 4690번 완전 세제곱 (0) | 2021.05.16 |