O_Egor

var 8

Jun 2nd, 2023
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int n;
  10.     cin >> n;
  11.  
  12.     vector<int> ans;
  13.  
  14.     for(int i = 0; i < n; ++i)
  15.     {
  16.         int a;
  17.         cin >> a;
  18.         if(abs(a % 10) != 1)
  19.         {
  20.             ans.push_back(a);
  21.         }
  22.     }
  23.  
  24.     for(int i : ans)
  25.     {
  26.         cout << i << ' ';
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment