#include <stdio.h> int main() { int arr[100][100]; int n, i, j; int column = 0, input = 1; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { arr[j][column] = input++; } column++; } for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { printf("%3d", arr[i][j]); } printf("\n"); } return 0; }
|