1041. 考试座位号(15) 结构体struct stu vector<stu> a(5);
来源:互联网 发布:convertfrom json 编辑:程序博客网 时间:2024/05/18 03:12
/*
4
10120150912233 2 4
10120150912119 4 1
10120150912126 1 3
10120150912002 3 2
2
3 4
输出样例:
10120150912002 2
10120150912119 1
*/
#include<iostream>
#include<string>
#include<vector>
using namespace std;
struct stu{
string s;
int a,b;
};
int main()
{
int n;
cin>>n;
vector <stu> x(n);
for(int i=0;i<n;i++)
{
cin>>x[i].s>>x[i].a>>x[i].b;
}
int m;
cin>>m;
vector<int> y(m);
for(int i=0;i<m;i++)
{
cin>>y[i];
}
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
if(y[i]==x[j].a)
{
cout<<x[j].s<<" "<<x[j].b<<endl;
}
}
}
return 0;
}
4
10120150912233 2 4
10120150912119 4 1
10120150912126 1 3
10120150912002 3 2
2
3 4
输出样例:
10120150912002 2
10120150912119 1
*/
#include<iostream>
#include<string>
#include<vector>
using namespace std;
struct stu{
string s;
int a,b;
};
int main()
{
int n;
cin>>n;
vector <stu> x(n);
for(int i=0;i<n;i++)
{
cin>>x[i].s>>x[i].a>>x[i].b;
}
int m;
cin>>m;
vector<int> y(m);
for(int i=0;i<m;i++)
{
cin>>y[i];
}
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
if(y[i]==x[j].a)
{
cout<<x[j].s<<" "<<x[j].b<<endl;
}
}
}
return 0;
}
阅读全文
0 0
- 1041. 考试座位号(15) 结构体struct stu vector<stu> a(5);
- struct student stu[];
- 疑问:typedef struct{}stu[50]; 和 struct {}stu[50];
- Debug Stu
- string stu = "12345"; stu = stu.Substring(stu.Length - 2); 为什么stu等于的是后两位
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 1041. 考试座位号(15)
- 第十二周周总结
- 字符编码
- 区间翻转问题 Splay
- PyQt5实时显示Camera
- python库之xlwt+xlrd+openpyxl
- 1041. 考试座位号(15) 结构体struct stu vector<stu> a(5);
- BZOJ3165: [Heoi2013]Segment(线段树)
- spring boot 404不匹配路径问题
- Java面试题大汇总
- 最小生成树Prim算法朴素版 C语言实现
- Java 基础总结
- ios自动更新(一)
- 给定Json数据格式,提取相关数据
- Unity3d 判断手势触摸的类型 ,判断手势的滑动方向,并获取刚触摸以及触摸结束事的坐标