1041 考试座位号
生活随笔
收集整理的這篇文章主要介紹了
1041 考试座位号
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
題目傳送門:https://pintia.cn/problem-sets/994805260223102976/problems/994805281567916032
題解:
#include<iostream> #include<string> using namespace std;struct Infor{string str;int num1;int num2; };void InitInfor(Infor infor[],int n){for(int i=0;i<n;i++){infor[i].str="";infor[i].num1=-1;infor[i].num2=-1;} }int main(){int n,M,temp;cin>>n;Infor infor[n];InitInfor(infor,n);for(int i=0;i<n;i++){cin>>infor[i].str>>infor[i].num1>>infor[i].num2;}cin>>M;while(M--){cin>>temp;for(int i=0;i<n;i++){if(temp==infor[i].num1) cout<<infor[i].str<<" "<<infor[i].num2<<endl;}}return 0; }?
轉載于:https://www.cnblogs.com/Gzu_zb/p/10497144.html
總結
以上是生活随笔為你收集整理的1041 考试座位号的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 以太坊源码分析——BlockChain
- 下一篇: react中实现异步请求的方法一,rea