[expelliarmus] the disarming charm [rictusempra] send a jet of silver light to hit the enemy [tarantallegra] control the movement of one‘s legs [serpensortia] shoot a snake out of the end of one‘s wand [lumos] light the wand [obliviate] the memory charm [expecto patronum] send a Patronus to the dementors [accio] the summoning charm @END@ 4 [lumos] the summoning charm [arha] take me to the sky
light the wand accio what? what?
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
char liu[100000][26],xp[100000][88];
char ac[86];
int main()
{
int i,j,k;
int t,n,m;
k=0;
int flag;
for(i=0;;i++)
{
for(j=0;;j++)
{
scanf("%c",&liu[i][j]);
if(liu[i][j]==‘]‘) break;
if(liu[i][0]==‘@‘&&liu[i][4]==‘@‘) break; //这里一定要输完这一句,不能第一个字母输完判断是@就break,会RE的!你break了人家还是要输完的啊!!!!!!切记!
}
if(liu[i][0]==‘@‘) break;
getchar();
gets(xp[i]);
k++;
}
cin>>t;
getchar();
while(t--)
{
flag=0;
gets(ac);
if(ac[0]==‘[‘)
{
for(i=0;i<k;i++)
{
if(strcmp(ac,liu[i])==0)
{
printf("%s\n",xp[i]);
flag=1;
break;
}
}
if(flag==0)
printf("what?\n");
}
else
{
for(i=0;i<k;i++)
{
if(strcmp(ac,xp[i])==0)
{
for(j=1;j<strlen(liu[i])-1;j++)
printf("%c",liu[i][j]);
printf("\n");
flag=1;
break;
}
}
if(flag==0)
printf("what?\n");
}
}
return 0;
}魔咒词典------HDOJ杭电1880(字符串的处理,很简单),布布扣,bubuko.com
魔咒词典------HDOJ杭电1880(字符串的处理,很简单)
原文地址:http://blog.csdn.net/u014231159/article/details/26300199