fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, a;
  7. cin >> n;
  8. for (int i = 0; i < n; i++)
  9. {
  10. cin >> a;
  11. if (i % 2 == 0)
  12. cout << a << " ";
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 4200KB
stdin
7
14 16 3 7 17 19 9
stdout
14 3 17 9