fork download
  1. /*
  2. Task: Problem 6.08
  3. Date: Dec 24, 2020
  4. Author: aLittleLove (Minh Vu)
  5. */
  6.  
  7. #include<bits/stdc++.h>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13. ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  14. //freopen("input.txt","r",stdin);
  15. int n, x; cin >> n;
  16. vector<int> a(n);
  17. for (int i=0; i<n; i++) cin >> a[i];
  18. cin >> x;
  19. for (int i=0; i<n; i++) if (a[i]!=x) cout << a[i] << " ";
  20. return 0;
  21. }
Success #stdin #stdout 0s 4944KB
stdin
8
2 9 5 6 9 8 9 1
9
stdout
2 5 6 8 1