Răspuns:
ex1
#include <iostream>
using namespace std;
int main(){
int v[1000],i,n;
cout << "Lungimea vectorului: ";
cin >> n;
cout << "Introduceti elementele:\n ";
for(i=1;i<=n;i++)
cin >> v[i];
for (i = 1;i<=n;i++)
if(i% 2 == 0)
cout<<v[i] <<" ";
cout << endl;
int s=n;
if(s%2==0) s--;
for(int i=s;i>=1;i=i-2)
cout<<v[i]<<" ";
return 0;
}
Explicație: