2016 where to go net pen question two

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.