Aštuonių valdovių uždavinys
Taškai: 0
Compile: FAIL
valdoves.cpp: In function ‘int main()’: valdoves.cpp:12:31: error: array size in new-expression must be constant bool** arr = new bool[n][n]; ^ valdoves.cpp:12:31: error: the value of ‘n’ is not usable in a constant expression valdoves.cpp:10:9: note: ‘int n’ is not const int n; ^ valdoves.cpp:14:24: error: ‘queens’ was not declared in this scope queens(arr, n, 0, 0); ^ valdoves.cpp: In function ‘bool* queens(bool*, int, int, int)’: valdoves.cpp:19:18: error: invalid types ‘bool[int]’ for array subscript arr[px][i] = true; ^ valdoves.cpp:20:18: error: invalid types ‘bool[int]’ for array subscript arr[i][py] = true; ^ valdoves.cpp:21:57: error: invalid types ‘bool[int]’ for array subscript if (px + i < n && py + i < n) arr[px + i][py + i] = true; ^ valdoves.cpp:22:57: error: invalid types ‘bool[int]’ for array subscript if (px + i < n && py - i > 0) arr[px + i][py - i] = true; ^ valdoves.cpp:23:57: error: invalid types ‘bool[int]’ for array subscript if (px - i > 0 && py + i < n) arr[px - i][py + i] = true; ^ valdoves.cpp:24:57: error: invalid types ‘bool[int]’ for array subscript if (px - i > 0 && py - i > 0) arr[px - i][py - i] = true; ^
nr. | result | time | message |
---|