单for循环!不用嵌套查找!
2025-08-12 16:32:46
发布于:北京
3阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
struct node{
int eng, ch, math;
};
map<string, node> mp;
int main(){
int n, q;
cin >> n;
while(n--){
string s;
int x, y, z;
cin >> s >> x >> y >> z;
mp[s].ch = x;
mp[s].math=y;
mp[s].eng = z;
}
cin >> q;
while(q--){
string t;
cin >> t;
cout << mp[t].ch << " " << mp[t].math << " " << mp[t].eng << endl;
}
}
这里空空如也
有帮助,赞一个