北邮oj-912星球的研究生
不解释了。
#include<bits/stdc++.h>
using namespace std;
#define maxn 105
struct St{
int id;
int score;
};
St s[maxn];
int size;
int main(){
int t,n,id,score;
char str[15];
scanf("%d",&t);
while(t--){
size = 0;
scanf("%d",&n);
while(n--){
scanf("%s",str);
if(strcmp(str,"Insert")==0){
scanf("%d %d",&id,&score);
s[size].id = id;
s[size++].score = score;
}
else if(strcmp(str,"Find")==0){
scanf("%d",&id);
bool flag = false;
for(int i=0;i<size;i++){
if(s[i].id==id){
printf("name:%d score:%d\n",s[i].id,s[i].score);
flag = true;
break;
}
}
if(flag==false){
printf("No result!\n");
}
}
}
}
return 0;
}