#includeusing namespace std; #define N 8 int table[N][N]; void printtable() { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout << table[i][j] << " "; } cout << endl; } } void copy(int s, int n) { for (int i = s; i < s + n / 2; i++) { for (int j = 0; j < n / 2; j++) { table[i + n / 2][j + n / 2] = table[i][j]; table[i][j + n / 2] = table[i + n / 2][j]; } } } void game(int s, int n) { if (n == 1) return; game(s, n / 2); game(s + n / 2, n / 2); copy(s, n); } void game(int n) { game(0, n); } int main() { for (int i = 0; i < N; i++) { table[i][0] = i + 1; } game(N); printtable(); return 0; }



