文章
84
粉丝
408
获赞
33
访问
872.2k
#include<iostream>
#include<string>
#include<vector>
using namespace std;
typedef struct node{
int num;
string name;
string sex;
int age;
}stu;
int main()
{
int m;
cin >> m;
while (m--) {
int N;
cin >> N;
vector<stu> vstu;
int num, age;
string name, sex;
while (N--) {
cin >> num >> name >> sex >> age;
stu student;
student.num = num;
student.name = name;
student.sex = sex;
student.age = age;
vstu.push_back(student);
}
cin >> num;
for (int i = 0; i < vstu.size(); i++) {
if (vstu[i].num == num)
cout << vstu[i].num << " " << vstu[i].name << " " << vstu[i].sex << " " << vstu[i].age << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发