本文共 1748 字,大约阅读时间需要 5 分钟。
[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 wandacciowhat?what?
#include<stdio.h>
#include<string.h> #include<cstdlib> #include<map> #include<iostream> #include<string> using namespace std; int main(){ string gongneng,id,temp; int n; pair<string,string> q,p; map<string,string> mp; while(cin>>q.first){ if(q.first=="@END@") break; getchar(); getline(cin,q.second); p.first=q.second,p.second=q.first; mp.insert(q); mp.insert(p); } scanf("%d",&n); getchar(); while(n--){ getline(cin,temp); map<string,string>::iterator it=mp.find(temp); if(it!=mp.end()){ if(it->second[0]=='['){ for(int i=1;i<it->second.size()-1;i++){ cout<<it->second[i]; } cout<<endl; } else cout<<it->second<<endl; } else if(it==mp.end()){ cout<<"what?"<<endl; } } return 0; }转载地址:http://dxtpi.baihongyu.com/