Răspuns:
#include <iostream>
using namespace std;
int n, v[100], w[100][100];
int main()
{
cin >> n;
for (int i=0; i<n; i++) {
cin >> v[i];
}
for (int j=0; j<n; j++) {
if (j%2==0) {
for (int i=n-1; i>=0; i--) {
w[i][j]=v[n-i-1];
}
}
else {
for (int i=0; i<n; i++) {
w[i][j]=v[i];
}
}
}
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
cout << w[i][j] << " ";
}
cout << endl;
}
return 0;
}
Explicație:
Succese!