Advertisement
ULK

Лабораторная №9 (11.102)

ULK
Dec 4th, 2022
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.  
  9.     cout << "Enter the number of elements" << endl;
  10.     cin >> n;
  11.  
  12.     int* A;
  13.     A = new int[n];
  14.     int sum = 0;
  15.     int i = 0;
  16.  
  17.  
  18.     cout << "Enter the elements" << endl;
  19.     for (i = 0; i < n; i++) {
  20.         cin >> A[i];
  21.     }
  22.  
  23.     for (i = 0; i < n; i++) {
  24.         if (A[i] == A[i + 1]) {
  25.             cout << "There is two number " << A[i] << "'s in the array";
  26.         }
  27.     }
  28.  
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement