SHARE
TWEET

Task 4.1

a guest Oct 21st, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int sizeFirst;
  8.     cin >> sizeFirst;
  9.     int *elementsFirst = new int[sizeFirst];
  10.  
  11.     for (int i = 0; i < sizeFirst; i++)
  12.         cin >> elementsFirst[i];
  13.  
  14.     int sizeSecond;
  15.     cin >> sizeSecond;
  16.     int* elementsSecond = new int[sizeSecond];
  17.  
  18.     for (int i = 0; i < sizeSecond; i++)
  19.         cin >> elementsSecond[i];
  20.  
  21.     for (int i = 0; i < sizeFirst; i++)
  22.         for (int j = 0; j < sizeSecond; j++)
  23.             if (elementsFirst[i] == elementsSecond[j])
  24.                 break;
  25.             else if (j == sizeSecond - 1) cout << elementsFirst[i];
  26. }
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