[ZJa135][UVA12250] Language Detection

題目:
http://zerojudge.tw/ShowProblem?problemid=a135
--------------------------------------------------------------------------------------------------------------------------
#include<iostream>
using namespace std;
string s[] = { "ENGLISH","SPANISH","GERMAN","FRENCH","ITALIAN","RUSSIAN" };
string he[] = { "HELLO","HOLA","HALLO","BONJOUR","CIAO","ZDRAVSTVUJTE" };
int main()
{
  int T = 0;
  string a;
  while( cin >> a && a != "#" )
{
    int z = 0;
    for(int i=0;i<6;i++)
{
      if(he[i] == a)
{
        printf("Case %d: %s\n", ++T,s[i].c_str());
        z = 1;
        break;
      }
    }

    if(!z)
      printf("Case %d: UNKNOWN\n", ++T);

  }
  return 0;
}

留言

這個網誌中的熱門文章

[ZJ]a227: 三龍杯 -> 河內之塔

建立 python 環境(windows 8)

[ZJ]b513: 判斷質數-商競103