[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;
}
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;
}
留言
張貼留言