#include <bits/stdc++.h> using namespace std; int n,k,j,i,b,_min; vector<string> a; struct p{ int id; string name; vector<int> gx; }; vector<p> list; p l; bool d(int z,string c){ for(int i=0;i<list[z].gx.size();i++){ if(d(list[z].gx[i])==true){ cout<<0; } } } int main(){ min=12; cout<<"失踪人ID:"; cin>>k; cout<<"查找人ID:"; i n>>b; l.gx.clear(); l.id=1; l.name="付书宣"; l.gx.push_back(2); l.gx.push_back(3); list.push_back(l); l.gx.clear(); l.id=2; l.name="宋阳"; l.gx.push_back(1); l.gx.push_back(3); l.gx.push_back(4); list.push_back(l); l.gx.clear(); l.id=3; l.name="刘佳兴"; l.gx.push_back(1); l.gx.push_back(2); l.gx.push_back(5); list.push_back(l); l.gx.clear(); l.id=4; l.name="王一行"; l.gx.push_back(2); l.gx.push_back(7); list.push_back(l); l.gx.clear(); l.id=5; l.name="韩旭尧"; l.gx.push_back(3); l.gx.push_back(11); list.push_back(l); l.gx.clear(); l.id=6; l.name="陈若麟"; l.gx.push_back(7); l.gx.push_back(8); list.push_back(l); l.gx.clear(); l.id=7; l.name="刘通"; l.gx.push_back(4); l.gx.push_back(6); l.gx.push_back(9); list.push_back(l); l.gx.clear(); l.id=8; l.name="付书恒"; l.gx.push_back(6); l.gx.push_back(10); list.push_back(l); l.gx.clear(); l.id=9; l.name="李寅睿"; l.gx.push_back(7); list.push_back(l); l.gx.clear(); l.id=10; l.name="王越硕"; l.gx.push_back(8); l.gx.push_back(11); list.push_back(l); l.gx.clear(); l.id=11; l.name="王华立"; l.gx.push_back(5); l.gx.push_back(10); list.push_back(l); for(i=0;i<list.size();i++){ cout<<list[i].id<<" "<<list[i].name<<" "; for(j=0;j<list[i].gx.size();j++){ cout<<list[i].gx[j]<<" "; } cout<<endl; } d(k,""); return 0; }
标签:name,list,back,find,push,gx,id From: https://www.cnblogs.com/liujiaxing-/p/18578107