Advertisement
Josif_tepe

Untitled

Feb 3rd, 2024
610
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n;
  9.     int niza[n];
  10.     for(int i = 0; i < n; i++) {
  11.         cin >> niza[i];
  12.     }
  13.     int kombinacii = 0;
  14.     for(int a = 0; a < n; a++) {
  15.         for(int b = a + 1; b < n; b++) {
  16.             for(int c = b + 1; c < n; c++) {
  17.                 for(int d = c + 1; d < n; d++) {
  18.                     if(niza[a] * niza[c] == niza[b] * niza[d]) {
  19.                         kombinacii++;
  20.                     }
  21.                 }
  22.             }
  23.         }
  24.     }
  25.     cout << kombinacii << endl;
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement