문제 링크입니다: www.acmicpc.net/problem/21638
21638번: SMS from MCHS
In case if any message has to be sent, output its text. Otherwise, output phrase "texttt{No message}". You can separate message words with spaces and line feeds arbitrarily.
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); | |
int t1, v1, t2, v2; | |
cin >> t1 >> v1 >> t2 >> v2; | |
if (t2 < 0 && v2 >= 10) | |
{ | |
cout << "A storm warning for tomorrow! Be careful and stay home if possible!\n"; | |
return 0; | |
} | |
if (t2 < t1) | |
{ | |
cout << "MCHS warns! Low temperature is expected tomorrow.\n"; | |
return 0; | |
} | |
if (v1 < v2) | |
{ | |
cout << "MCHS warns! Strong wind is expected tomorrow.\n"; | |
return 0; | |
} | |
cout << "No message\n"; | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 21611번 마법사 상어와 블리자드 (0) | 2021.05.03 |
---|---|
백준 20058번 마법사 상어와 파이어스톰 (2) | 2021.05.03 |
BOJ 21633번 Bank Transfer (0) | 2021.05.02 |
백준 21631번 Checkers (0) | 2021.05.02 |
백준 21612번 Boiling Water (0) | 2021.05.02 |