Advertisement
Ilya_konstantinov

Untitled

Dec 5th, 2023
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | Source Code | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include "func_e.h"
  4.  
  5. using std::cin; using std::cout;
  6. using std::vector; using std::string;
  7. using std::endl;
  8.  
  9. int main() {
  10.   int a[(int)1e4];
  11.   size_t n; cin >> n;
  12.   for (int i = 0; i < n; ++i)
  13.     cin >> a[i];
  14.  
  15.   unique(a, &n);
  16.  
  17.   for (int i = 0; i < n-1; ++i)
  18.     std::cout << a[i] << ' ';  
  19.   std::cout << a[n-1] << std::endl;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement