Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. void cartesian(int array[],int arraySize)
  7. {
  8.     for (int i = 0; i < arraySize; i++)
  9.     {
  10.         for (int y = 0; y < arraySize; i++)
  11.         {
  12.             cout << array[i] * array[y] << " ";
  13.         }
  14.     }
  15. }
  16.  
  17. int main()
  18. {
  19.     int arraySize;
  20.     cin >> arraySize;
  21.     int array[100];
  22.    
  23.     for (int i = 0; i < arraySize; i++)
  24.     {
  25.         cin >> array[i];
  26.     }
  27.     cartesian(array, arraySize);
  28.  
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement