#1518
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 | #63772162 | Utilizator | |
| Fișier | sudoku.cpp | Dimensiune | 1.17 KB |
| Data încărcării | 18 Martie 2026, 12:41 | Scor/rezultat | Eroare de compilare |
sudoku.cpp:3:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("sudoku.in"); ^ sudoku.cpp:4:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("sudoku.out"); ^ sudoku.cpp:5:1: error: 'inta' does not name a type inta[10][10]; ^ sudoku.cpp: In function 'void citire()': sudoku.cpp:10:14: error: 'a' was not declared in this scope fin>>a[i][j]; ^ sudoku.cpp: In function 'void afisare()': sudoku.cpp:16:15: error: 'a' was not declared in this scope fout<<a[i][j]<<' '; ^ sudoku.cpp: In function 'int valid(int, int)': sudoku.cpp:23:9: error: 'a' was not declared in this scope if(a[i][j1]==a[i][j]&&j1!=j)return 0; ^ sudoku.cpp:24:12: warning: statement has no effect [-Wunused-value] for(i1;i1<=9;i1++) ^ sudoku.cpp:25:10: error: 'a' was not declared in this scope if (a[i1][j]==a[i][j]&&i1!=i)return 0; ^ sudoku.cpp:29:14: error: 'a' was not declared in this scope if(a[i1][j1]==a[i][j]&&(i1!=1||j1!=j))return 0; ^ sudoku.cpp: At global scope: sudoku.cpp:32:14: error: expected ',' or '...' before numeric constant void bkt(int 1, int j) ^ sudoku.cpp: In function 'void bkt(int)': sudoku.cpp:34:8: error: 'i' was not declared in this scope if(i>9)afisare(); ^ sudoku.cpp:36:16: error: 'a' was not declared in this scope if(a[i][j]!=0){if(j<9)bkt(i,j+1); ^ sudoku.cpp:36:21: error: 'j' was not declared in this scope if(a[i][j]!=0){if(j<9)bkt(i,j+1); ^ sudoku.cpp:41:23: error: expected ')' before '{' token if(valid(i,j){ ^ sudoku.cpp: In function 'int main()': sudoku.cpp:51:17: error: too many arguments to function 'void bkt(int)' citire();bkt(1,1) ^ sudoku.cpp:32:6: note: declared here void bkt(int 1, int j) ^ sudoku.cpp:52:1: error: expected ';' before '}' token } ^
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ă.