SHARE
TWEET

Untitled

a guest Apr 26th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4.  
  5. using namespace std;
  6. vector<int> q2, q3;
  7. int read(){
  8.     int x;
  9.     cin >> x;
  10.     return x;
  11. }
  12. void print(int x){
  13.     cout << x << " ";
  14. }
  15. void printif(int x){
  16.     if(find(q2.begin(), q2.end(), x) == q2.end() && find(q3.begin(), q3.end(), x) == q3.end()) cout<< x<<" ";
  17. }
  18.  
  19. int change(int& x){
  20.     if(x>=0 ){
  21.         x*=2;
  22.     }
  23.     else if(x%2!=0){
  24.        
  25.             x/=2;
  26.             x-=1;
  27.        
  28.     }
  29.     else{
  30.         x/=2;
  31.     }
  32.     return x;
  33. }
  34. int main() {
  35.     int n;
  36.     cin>>n;
  37.     vector<int> q(n);
  38.    
  39.     generate(q.begin(), q.end(), read);
  40.     cin>> n;
  41.     q2.resize(n);
  42.     generate(q2.begin(), q2.end(), read);
  43.     cin>> n;
  44.     q2.resize(n);
  45.     generate(q2.begin(), q2.end(), read);
  46.    
  47.     //for_each(q.begin(), q.end(), change);
  48.  
  49.     for_each(q.begin(), q.end(), printif);
  50.  
  51.    
  52.  
  53.  
  54.     system("pause");
  55.     return 0;
  56. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top