intmain() { int n, list[100], s, e; while (scanf(" %d", &n) == 1) { for (int i = 0; i < n; i++) scanf(" %d", &list[i]); s = 0, e = n - 1; while (s <= e) { for (int i = e; i >= s; i--) printf("%d ", list[i]); putchar('\n'); e--; for (int i = s; i <= e; i++) printf("%d ", list[i]); putchar('\n'); s++; } } return0; }
intmain() { int n, list[100], s, e; while (scanf(" %d", &n) == 1) { for (int i = 0; i < n; i++) scanf(" %d", &list[i]); s = 0, e = n - 1; while (s <= e) { for (int i = s; i <= e; i++) putUInt(list[i], ' '); putchar('\n'); s++; for (int i = e; i >= s; i--) putUInt(list[i], ' '); putchar('\n'); e--; } } return0; }