#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 | #22616861 | Utilizator | |
Fișier | sudoku.c | Dimensiune | 5.37 KB |
Data încărcării | 26 Aprilie 2020, 16:14 | Scor / rezultat | Eroare de compilare |
sudoku.c: In function 'main': sudoku.c:11:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i=0;i<9;++i) ^ sudoku.c:11:5: note: use option -std=c99 or -std=gnu99 to compile your code sudoku.c:12:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int j=0;j<9;++j) ^ sudoku.c:24:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int i=0;i<9 && freecells;i+=3) ^ sudoku.c:25:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int j=0;j<9 && freecells;j+=3) ^ sudoku.c:27:17: error: 'for' loop initial declarations are only allowed in C99 mode for (int cif=1;cif<10;++cif) ^ sudoku.c:30:21: error: 'for' loop initial declarations are only allowed in C99 mode for (int k=i;k<i+3;++k) ^ sudoku.c:31:25: error: 'for' loop initial declarations are only allowed in C99 mode for (int l=j;l<j+3;++l) ^ sudoku.c:42:17: error: 'for' loop initial declarations are only allowed in C99 mode for (int k=i;k<i+3;++k) ^ sudoku.c:43:21: error: 'for' loop initial declarations are only allowed in C99 mode for (int l=j;l<j+3;++l) ^ sudoku.c:46:26: error: redefinition of 'cif' for (int cif=1;cif<10;++cif) ^ sudoku.c:27:26: note: previous definition of 'cif' was here for (int cif=1;cif<10;++cif) ^ sudoku.c:46:17: error: 'for' loop initial declarations are only allowed in C99 mode for (int cif=1;cif<10;++cif) ^ sudoku.c:49:26: error: redefinition of 'k' for (int k=i;k<i+3;++k) ^ sudoku.c:42:26: note: previous definition of 'k' was here for (int k=i;k<i+3;++k) ^ sudoku.c:49:17: error: 'for' loop initial declarations are only allowed in C99 mode for (int k=i;k<i+3;++k) ^ sudoku.c:50:30: error: redefinition of 'l' for (int l=j;l<j+3;++l) ^ sudoku.c:43:30: note: previous definition of 'l' was here for (int l=j;l<j+3;++l) ^ sudoku.c:50:21: error: 'for' loop initial declarations are only allowed in C99 mode for (int l=j;l<j+3;++l) ^ sudoku.c:54:29: error: 'for' loop initial declarations are only allowed in C99 mode for (int m=0;m<nr;++m) ^ sudoku.c:65:18: error: redefinition of 'i' for (int i=0;i<9 && freecells;i++) ^ sudoku.c:24:18: note: previous definition of 'i' was here for (int i=0;i<9 && freecells;i+=3) ^ sudoku.c:65:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int i=0;i<9 && freecells;i++) ^ sudoku.c:67:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int cif=1;cif<10;++cif) ^ sudoku.c:70:17: error: 'for' loop initial declarations are only allowed in C99 mode for (int j=0;j<9;++j) ^ sudoku.c:81:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int j=0;j<9;++j) ^ sudoku.c:84:22: error: redefinition of 'cif' for (int cif=1;cif<10;++cif) ^ sudoku.c:67:22: note: previous definition of 'cif' was here for (int cif=1;cif<10;++cif) ^ sudoku.c:84:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int cif=1;cif<10;++cif) ^ sudoku.c:87:22: error: redefinition of 'j' for (int j=0;j<9;++j) ^ sudoku.c:81:22: note: previous definition of 'j' was here for (int j=0;j<9;++j) ^ sudoku.c:87:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int j=0;j<9;++j) ^ sudoku.c:91:21: error: 'for' loop initial declarations are only allowed in C99 mode for (int m=0;m<nr;++m) ^ sudoku.c:102:18: error: redefinition of 'j' for (int j=0;j<9 && freecells;j++) ^ sudoku.c:25:22: note: previous definition of 'j' was here for (int j=0;j<9 && freecells;j+=3) ^ sudoku.c:102:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int j=0;j<9 && freecells;j++) ^ sudoku.c:104:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int cif=1;cif<10 && freecells;++cif) ^ sudoku.c:107:17: error: 'for' loop initial declarations are only allowed in C99 mode for (int i=0;i<9;++i) ^ sudoku.c:118:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int i=0;i<9;++i) ^ sudoku.c:121:22: error: redefinition of 'cif' for (int cif=1;cif<10;++cif) ^ sudoku.c:104:22: note: previous definition of 'cif' was here for (int cif=1;cif<10 && freecells;++cif) ^ sudoku.c:121:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int cif=1;cif<10;++cif) ^ sudoku.c:124:22: error: redefinition of 'i' for (int i=0;i<9;++i) ^ sudoku.c:118:22: note: previous definition of 'i' was here for (int i=0;i<9;++i) ^ sudoku.c:124:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int i=0;i<9;++i) ^ sudoku.c:128:21: error: 'for' loop initial declarations are only allowed in C99 mode for (int m=0;m<nr;++m) ^ sudoku.c:141:14: error: redefinition of 'i' for (int i=0;i<9;++i) ^ sudoku.c:11:14: note: previous definition of 'i' was here for (int i=0;i<9;++i) ^ sudoku.c:141:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i=0;i<9;++i) ^ sudoku.c:143:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int j=0;j<9;++j) ^ sudoku.c:8:12: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result [-Wunused-result] freopen("sudoku.in","r",stdin); ^ sudoku.c:14:18: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",a[i]+j); ^ sudoku.c:140:12: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result [-Wunused-result] freopen("sudoku.out","r",stdout); ^
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ă.