Răspuns:
#include<iostream>
using namespace std;
int main()
{
int n,ind_par,v[100],ind_impar;
cin>>n;
ind_impar=1;
ind_par=n;
for(int i=1;i<=n;i++)
if(i%2==1)
{
v[i]=ind_impar;
ind_impar++;
}
else
{
v[i]=ind_par;
ind_par--;
}
for(int i=1;i<=n;i++)
cout<<v[i]<<' ';
}
Explicație: