文章

70

粉丝

0

获赞

226

访问

7.1k

头像
查找学生信息2 题解:
P1476 清华大学机试题
发布于2026年3月18日 17:22
阅读数 113

#include<stdio.h>
#include<string>
#include<string.h>
#include<iostream>
#include<map>

using namespace std;

struct stu{
    string id;
    string name;
    string gender;
    int age;
};

int main(){
    map<string,stu> list;
    int n,m;
    while(cin>>n){
        stu temp;
        for(int i=0; i<n; i++){
            cin >>temp.id>>temp.name>>temp.gender>>temp.age;
            list[temp.id] = temp;
        }

        cin>>m;
        string * number = new string[m];
        for(int i=0; i<m; i++) cin>>nu...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发