#1281
Regine1
Se consideră o tablă de șah de dimensiune n
. Să se plaseze pe tablă n
regine astfel încât să nu existe două regine care să se atace.
Problema | Regine1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53007864 | Utilizator | |
Fișier | regine1.cpp | Dimensiune | 749 B |
Data încărcării | 15 Octombrie 2024, 13:23 | Scor / rezultat | Eroare de compilare |
regine1.cpp:18:1: error: stray '\342' in program { for(int i=1 ; i<=n ; i++) { for(int j = 1 ; j <= n ; j++) if(st[j]==i) cout << “* “; else cout << “- “; ^ regine1.cpp:18:1: error: stray '\200' in program regine1.cpp:18:1: error: stray '\234' in program regine1.cpp:18:1: error: stray '\342' in program regine1.cpp:18:1: error: stray '\200' in program regine1.cpp:18:1: error: stray '\234' in program regine1.cpp:18:1: error: stray '\342' in program regine1.cpp:18:1: error: stray '\200' in program regine1.cpp:18:1: error: stray '\234' in program regine1.cpp:18:1: error: stray '\342' in program regine1.cpp:18:1: error: stray '\200' in program regine1.cpp:18:1: error: stray '\234' in program regine1.cpp:20:1: error: stray '\342' in program { for(int i=1 ; i<=n ; i++) { for(int j = 1 ; j <= n ; j++) if(st[j]==i) cout << “* “; else cout << “- “; ^ regine1.cpp:20:1: error: stray '\200' in program regine1.cpp:20:1: error: stray '\234' in program regine1.cpp:20:1: error: stray '\342' in program regine1.cpp:20:1: error: stray '\200' in program regine1.cpp:20:1: error: stray '\234' in program regine1.cpp:20:1: error: stray '\342' in program regine1.cpp:20:1: error: stray '\200' in program regine1.cpp:20:1: error: stray '\234' in program regine1.cpp:20:1: error: stray '\342' in program regine1.cpp:20:1: error: stray '\200' in program regine1.cpp:20:1: error: stray '\234' in program regine1.cpp:24:8: error: stray '\342' in program } else k—; } return 0; } ^ regine1.cpp:24:8: error: stray '\200' in program regine1.cpp:24:8: error: stray '\224' in program regine1.cpp: In function 'void init()': regine1.cpp:6:3: error: 'st' was not declared in this scope { st[k]=0; ^ regine1.cpp: In function 'bool suc()': regine1.cpp:9:6: error: 'st' was not declared in this scope { if(st[k]<n) { st[k]++; return 1; } ^ regine1.cpp: In function 'bool valid()': regine1.cpp:12:34: error: 'st' was not declared in this scope { for(int i=1; i<=k-1; i++) { if(st[k]==st[i] || abs(st[i]-st[k])==k-i) return 0; } return 1; ^ regine1.cpp: In function 'void tipar()': regine1.cpp:18:64: error: 'st' was not declared in this scope { for(int i=1 ; i<=n ; i++) { for(int j = 1 ; j <= n ; j++) if(st[j]==i) cout << “* “; else cout << “- “; ^ regine1.cpp:18:90: error: expected primary-expression before ';' token { for(int i=1 ; i<=n ; i++) { for(int j = 1 ; j <= n ; j++) if(st[j]==i) cout << “* “; else cout << “- “; ^ regine1.cpp:18:113: error: expected primary-expression before ';' token { for(int i=1 ; i<=n ; i++) { for(int j = 1 ; j <= n ; j++) if(st[j]==i) cout << “* “; else cout << “- “; ^ regine1.cpp:20:1: error: a function-definition is not allowed here before '{' token { for(int i=1 ; i<=n ; i++) { for(int j = 1 ; j <= n ; j++) if(st[j]==i) cout << “* “; else cout << “- “; ^ regine1.cpp:24:33: error: expected '}' at end of input } else k—; } return 0; } ^ regine1.cpp:24:33: error: expected '}' at end of input regine1.cpp: In function 'bool suc()': regine1.cpp:10:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Regine1 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ă.