#210
Să se parcurgă în sensul acelor de ceasornic chenarul exterior al unei matrice pătratice.
Variante Bacalaureat 2009
| Problema | Chenar | Operații I/O |
chenar.in/chenar.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64893811 | Utilizator | |
| Fișier | chenar.cpp | Dimensiune | 552 B |
| Data încărcării | 10 Iunie 2026, 09:51 | Scor/rezultat | Eroare de compilare |
chenar.cpp:5:13: error: variable ‘std::ifstream fin’ has initializer but incomplete type 5 | ifstream fin("chenar.in") | ^ chenar.cpp:6:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 6 | ofstream fout("chenar.out") | ^~~~~~~~ chenar.cpp: In function ‘int main()’: chenar.cpp:11:13: error: ‘n’ was not declared in this scope 11 | fin >n; | ^ chenar.cpp:13:14: error: ‘a’ was not declared in this scope 13 | fin>>a[1][j]<<" "; | ^ chenar.cpp:15:12: error: lvalue required as left operand of assignment 15 | for(1=1;1<=n;i++) | ^ chenar.cpp:16:9: error: ‘fout’ was not declared in this scope 16 | fout<<a[1][j]<<" "; | ^~~~ chenar.cpp:16:15: error: ‘a’ was not declared in this scope 16 | fout<<a[1][j]<<" "; | ^ chenar.cpp:18:12: error: lvalue required as left operand of assignment 18 | for(1=2;i<=n;i++) | ^ chenar.cpp:19:9: error: ‘fout’ was not declared in this scope 19 | fout<<a[i][n]<<" "; | ^~~~ chenar.cpp:19:15: error: ‘a’ was not declared in this scope 19 | fout<<a[i][n]<<" "; | ^ chenar.cpp:21:21: error: lvalue required as decrement operand 21 | for(1=n;i>=1;1--) | ^ chenar.cpp:22:9: error: ‘fout’ was not declared in this scope 22 | fout<<a[n][1]<<" "; | ^~~~ chenar.cpp:22:15: error: ‘a’ was not declared in this scope 22 | fout<<a[n][1]<<" "; | ^ chenar.cpp:25:9: error: ‘fout’ was not declared in this scope 25 | fout<<a[i][1]<<" "; | ^~~~ chenar.cpp:25:15: error: ‘a’ was not declared in this scope 25 | fout<<a[i][1]<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Chenar 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ă.