#1518
sudoku
Scrieţi un program care, pentru o matrice 9 x 9
dată, reprezentând un puzzle SUDOKU, determină o soluţie a unui astfel de puzzle.
Problema | sudoku | Operații I/O |
sudoku.in /sudoku.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #8594630 | Utilizator | |
Fișier | sudoku.c | Dimensiune | 2.84 KB |
Data încărcării | 02 Martie 2018, 14:30 | Scor / rezultat | Eroare de compilare |
sudoku.c: In function 'valid': sudoku.c:17:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1; i <= n; ++i){ ^ sudoku.c:17:5: note: use option -std=c99 or -std=gnu99 to compile your code sudoku.c:24:13: error: redefinition of 'i' for(int i = cadran[apartin[x][y]].x; i <= cadran[apartin[x][y]].x + 2; ++i){ ^ sudoku.c:17:13: note: previous definition of 'i' was here for(int i = 1; i <= n; ++i){ ^ sudoku.c:24:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = cadran[apartin[x][y]].x; i <= cadran[apartin[x][y]].x + 2; ++i){ ^ sudoku.c:25:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = cadran[apartin[x][y]].y; j <= cadran[apartin[x][y]].y + 2; ++j){ ^ sudoku.c: In function 'afisare': sudoku.c:37:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1; i <= n; ++i){ ^ sudoku.c:38:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = 1; j <= n; ++j){ ^ sudoku.c: In function 'back': sudoku.c:45:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1; i <= 9 && !ok; ++i){ ^ sudoku.c: In function 'main': sudoku.c:80:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1; i <= 9; ++i){ ^ sudoku.c:81:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = cadran[i].x; j <= cadran[i].x + 2; ++j){ ^ sudoku.c:82:13: error: 'for' loop initial declarations are only allowed in C99 mode for(int k = cadran[i].y; k <= cadran[i].y + 2; ++ k){ ^ sudoku.c:87:13: error: redefinition of 'i' for(int i = 1; i <= n; ++i){ ^ sudoku.c:80:13: note: previous definition of 'i' was here for(int i = 1; i <= 9; ++i){ ^ sudoku.c:87:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1; i <= n; ++i){ ^ sudoku.c:88:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = 1; j <= n; ++j){ ^ sudoku.c:97:13: error: redefinition of 'i' for(int i = 1; i <= nr; ++i){ ^ sudoku.c:87:13: note: previous definition of 'i' was here for(int i = 1; i <= n; ++i){ ^ sudoku.c:97:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1; i <= nr; ++i){ ^ sudoku.c:99:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = 1; j <= n; ++j){ ^ sudoku.c:109:17: error: redefinition of 'j' for(int j = cadran[index_cadran].x; j <= cadran[index_cadran].x + 2; ++j){ ^ sudoku.c:99:17: note: previous definition of 'j' was here for(int j = 1; j <= n; ++j){ ^ sudoku.c:109:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = cadran[index_cadran].x; j <= cadran[index_cadran].x + 2; ++j){ ^ sudoku.c:110:13: error: 'for' loop initial declarations are only allowed in C99 mode for(int k = cadran[index_cadran].y; k <= cadran[index_cadran].y + 2; ++k){ ^ sudoku.c:89:19: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(f,"%d",&a[i][j]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sudoku face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.