fork download
  1. /* hng.*/
  2.  
  3. #include <bits/stdc++.h>
  4. #define fast \
  5.   ios::sync_with_stdio(false); \
  6.   cin.tie(nullptr); \
  7.   cout.tie(nullptr);
  8. using namespace std;
  9.  
  10. int main() {
  11. fast;
  12.  
  13. int n;
  14. cin >> n;
  15.  
  16. int a[n];
  17. for(int i = 0; i < n; i++){
  18. cin >> a[i];
  19. cout << a[i] << ' ';
  20. }
  21.  
  22. cout << '\n';
  23.  
  24. for(int i = 0; i < n; i++){
  25. if(a[i] % 2 == 0) cout << a[i] << ' ';
  26. }
  27.  
  28. }
  29.  
Success #stdin #stdout 0.01s 5320KB
stdin
3
36 67 36363636
stdout
36 67 36363636 
36 36363636