趕快加入我們來參與討論吧!
您需要 登錄 才可以下載或查看,沒有帳號?加入我們
x
原題:http://codeforces.com/contest/452/problem/A
AC:http://codeforces.com/contest/452/submission/7272563
有人提到CF,想說看看題目,結果就發現了這一題XD:告訴你所有eevee的進化型名稱,mask一些字元後,問你這是哪一隻,保證答案唯一,連大小寫變化都沒有,順秒XD
[C++] 純文本查看 復制代碼 #include<iostream>
#include<cstring>
using namespace std;
int main()
{
const char source[][10]={"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"};
char in[10];
int n,len;
bool flag=false;
cin>>len>>in;
for(int i=0;i<8;++i)
{
if(strlen(source[i])==len)
{
bool match=true;
for(int j=0;j<len;++j)
{
if(!(in[j]=='.'||in[j]==source[i][j])){
match=false;
break;
}
}
if(match){
cout<<source[i]<<endl;
break;
}
}
}
}
|