fragment-header
fragment-markdown
홈
로그인
로그아웃
내 블로그
설정
로그인
Atcoder Beginner Contest 419-A (C++) AtCoder Language
최초 업로드: 2025-08-16 14:06:06
최근 수정 시간: 2025-08-16 14:06:26
게시자: rlatjwls3333
카테고리: Atcoder
조회수: 25
# A - AtCoder Language [문제 링크](https://atcoder.jp/contests/abc419/tasks/abc419_a) ## Problem Statement Takahashi is learning AtCoderish Language. He memorizes AtCoderish words corresponding to English words. He knows that `red`, `blue`, and `green` in English respectively correspond to `SSS`, `FFF`, and `MMM` in AtCoderish, and he knows no other words. You are given a string $S$ consisting of lowercase English letters. If $S$ equals an English word that Takahashi knows corresponds to an AtCoderish word, output the AtCoderish word corresponding to $S$; otherwise, output the string `Unknown`. ## Constraints - $S$ is a string of length between $1$ and $10$, inclusive, consisting of English letters. ## Input The input is given from Standard Input in the following format: $S$ ## Output Output a string according to the instructions in the problem statement. ## 풀이 #### 문자열 비교를 이용하여 출력하면 된다. ``` c++ #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; if(s.compare("red")==0) cout << "SSS"; else if(s.compare("blue")==0) cout << "FFF"; else if(s.compare("green")==0) cout << "MMM"; else cout << "Unknown"; } ```