The test instructions of the second topic is probably a given three unordered array a,b,c; the numbers in each of these three arrays are not duplicated, but there may be numbers in three arrays.
If you do, please press the output from small to large, if not output.
1#include <iostream>2#include <vector>3#include <stdio.h>4#include <stdlib.h>5 //#include <cstdio.h>6#include <string>7#include <algorithm>8 9 using namespacestd;Ten One A - intMain () - { the - - intn,m,p; - inttemp; +Cin>>N; - +vector<int>num1,num2,num3; A for(inti =0; i<n;++i) at { -Cin>>temp; - Num1.push_back (temp); - } -Cin>>m; - for(inti =0; i<m;++i) in { -Cin>>temp; to Num2.push_back (temp); + } - theCin>>p; * for(inti =0; i<p;++i) $ {Panax NotoginsengCin>>temp; - Num3.push_back (temp); the } + A sort (Num1.begin (), Num1.end ()); the sort (Num2.begin (), Num2.end ()); + sort (Num3.begin (), Num3.end ()); - $ inti =0, j =0, k =0; $ BOOLFlag =false; - while(I < n && j< m && k<p) - { the while(num2[j]<Num1[i]) - {Wuyi++J; the } - while(num3[k]<Num1[i]) Wu { -++K; About } $ if(Num1[i] ==num2[j] && num1[i] = =Num3[k]) - { - if(!flag) - { Acout<<Num1[i]; +Flag =true; the}Else - { $cout<<" "<<Num1[i]; the } the the } thei++; - } in the thecout<<Endl; About theSystem"Pause"); the return 0; the}
2016 where to go net pen question two