#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 | #64412812 | Utilizator | |
| Fișier | chenar.cpp | Dimensiune | 855 B |
| Data încărcării | 05 Mai 2026, 18:28 | Scor/rezultat | Eroare de compilare |
chenar.cpp:11:1: error: ‘ifstream’ does not name a type 11 | ifstream fin("chenar.in"); | ^~~~~~~~ chenar.cpp:12:2: error: ‘ofstream’ does not name a type 12 | ofstream fout("chenar.out"); | ^~~~~~~~ chenar.cpp: In function ‘int main()’: chenar.cpp:17:9: error: ‘fin’ was not declared in this scope 17 | fin>>n; | ^~~ chenar.cpp:18:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 18 | for(i=1; i<=n; i++) | ^~~ chenar.cpp:22:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 22 | for(j=1; j<=n; j++) | ^~~ chenar.cpp:24:21: error: ‘fout’ was not declared in this scope 24 | fout<<mat[1][j]<<" "; | ^~~~ chenar.cpp:28:21: error: ‘fout’ was not declared in this scope 28 | fout<<mat[i][n]<<" "; | ^~~~ chenar.cpp:33:17: error: ‘fout’ was not declared in this scope 33 | fout<<mat[n][j]<<" "; | ^~~~ chenar.cpp:32:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 32 | for(j=n-1; j>=1; j--) | ^~~ chenar.cpp:34:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 34 | for(i=n-1; i>=2; i--) | ^~~ chenar.cpp:35:17: error: ‘fout’ was not declared in this scope 35 | fout<<mat[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ă.