Răspuns :
#include <iostream>
using namespace std;
int main(){
int n,i;
cin >> n;
for(i=1;i<=n;i+=2) cout << i << " ";
cout << endl;
if(n%2==1)n--;
for(i=n;i>0;i-=2) cout << i << " ";
}
Explicatie :
Mergand din 2 in 2 putem "selecta" doar numerele pare/impare.