#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 | #64345608 | Utilizator | |
| Fișier | chenar.cpp | Dimensiune | 979 B |
| Data încărcării | 30 Aprilie 2026, 18:15 | Scor/rezultat | Eroare de compilare |
chenar.cpp:5:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 5 | ofstream fout("chenar.out") | ^~~~~~~~ chenar.cpp: In function ‘int main()’: chenar.cpp:9:10: error: ‘n’ was not declared in this scope 9 | cin>>n; | ^ chenar.cpp:10:9: error: ‘i’ was not declared in this scope 10 | for(i=1; i<=n; i++) | ^ chenar.cpp:11:13: error: ‘j’ was not declared in this scope 11 | for(j=1; j<=n; j++) | ^ chenar.cpp:13:18: error: ‘a’ was not declared in this scope 13 | fin>>a[i][j]; | ^ chenar.cpp:15:9: error: ‘i’ was not declared in this scope 15 | for(i=1; i<=n; i++) | ^ chenar.cpp:16:13: error: ‘j’ was not declared in this scope 16 | for(j=1; j<=n; j++) | ^ chenar.cpp:20:17: error: ‘fout’ was not declared in this scope 20 | fout<<a[i][j]<<" "; | ^~~~ chenar.cpp:20:23: error: ‘a’ was not declared in this scope 20 | fout<<a[i][j]<<" "; | ^ chenar.cpp:23:9: error: ‘i’ was not declared in this scope 23 | for(i=2; i<=n; i++) | ^ chenar.cpp:24:13: error: ‘j’ was not declared in this scope 24 | for(j=1; j<=n; j++) | ^ chenar.cpp:28:17: error: ‘fout’ was not declared in this scope 28 | fout<<a[i][j]<<" "; | ^~~~ chenar.cpp:28:23: error: ‘a’ was not declared in this scope 28 | fout<<a[i][j]<<" "; | ^ chenar.cpp:31:9: error: ‘i’ was not declared in this scope 31 | for(i=n; i>=1; i--) | ^ chenar.cpp:32:13: error: ‘j’ was not declared in this scope 32 | for(j=n-1; j>=1; j--) | ^ chenar.cpp:36:17: error: ‘fout’ was not declared in this scope 36 | fout<<a[i][j]<<" "; | ^~~~ chenar.cpp:36:23: error: ‘a’ was not declared in this scope 36 | fout<<a[i][j]<<" "; | ^ chenar.cpp:39:9: error: ‘i’ was not declared in this scope 39 | for(i=n; i>=2; i--) | ^ chenar.cpp:40:13: error: ‘j’ was not declared in this scope 40 | for(j=1; j<=n; j++) | ^ chenar.cpp:44:17: error: ‘fout’ was not declared in this scope 44 | fout<<a[i][j]<<" "; | ^~~~ chenar.cpp:44:23: error: ‘a’ was not declared in this scope 44 | fout<<a[i][j]<<" "; | ^
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ă.