[UVa #12250] Language Detection

tolelom·2022년 7월 3일
0

UVa

목록 보기
11/20

문제 설명

문제 링크
주어진 문자열이 6개의 나라 중 어느 나라의 인사말인지 대답하면 되는 문제

알고리즘

그냥 분기 구현 문제

코드

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 1000000000

int t;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    for (int tc = 1; ; tc++){
        string s;
        cin >> s;

        if (s == "#") break;

        cout << "Case " <<  tc << ": ";
        if (s == "HELLO")
             cout << "ENGLISH" << '\n';
        else if (s == "HOLA")
            cout << "SPANISH" << '\n';
        else if (s == "HALLO")
            cout << "GERMAN" << '\n';
        else if (s == "BONJOUR")
            cout << "FRENCH" << '\n';
        else if (s == "CIAO")
            cout << "ITALIAN" << '\n';
        else if (s == "ZDRAVSTVUJTE")
            cout << "RUSSIAN" << '\n';
        else
            cout << "UNKNOWN" << '\n';

    }
}
profile
이것 저것 작성하는 기술 블로그

0개의 댓글