Advertisement
ZergRushA

array-lab-18.10.2022

Oct 17th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include<iostream>
  2.  
  3.  
  4. int main()
  5. {
  6.     int i, j;
  7.     int counter = 0;
  8.    
  9.     int array_1[5] = {5,2,50,33,10};
  10.     int array_2[5] = {4,16,7,9,67};
  11.    
  12.     int arr_len = (sizeof(array_1)/sizeof(*array_1));
  13.    
  14.     for (i = 0; i < arr_len; i++){
  15.         for (j = 0; j < arr_len; j++){
  16.          
  17.           if (array_1[i] < array_2[j]){
  18.               counter++;
  19.               std::cout << "Pair number " << counter << " is  " << array_1[i] << " -- "<< array_2[j]<< std::endl;
  20.           };  
  21.         };
  22.     };
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement