#include <stdio.h> int main() { int size; int i, j; scanf("%d", &size); for (i = 1; i <= size; i++) { for (j = size * size - (size - 1); j < size * size; j++) { printf("%d ", j); } printf("%dn", j); } return 0; }
Must output when entering 2
3 4 2 1
at 4
13 14 15 16 9 10 11 12 5 6 7 8 1 2 3 4
I just get all the last lines in a row like this
13 14 15 16 13 14 15 16 13 14 15 16 13 14 15 16
I can not figure out how to get the 2nd, 3rd and final one.