#211
Spirala
Să se parcurgă o matrice pătratică în spirală în sensul acelor de ceasornic.
Problema | Spirala | Operații I/O |
![]() spirala.in /spirala.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #39476553 | Utilizator | |
Fișier | spirala.cpp | Dimensiune | 643 B |
Data încărcării | 09 Noiembrie 2022, 15:28 | Scor / rezultat | Eroare de compilare |
spirala.cpp: In function 'int main()': spirala.cpp:6:5: error: 'ifstream' was not declared in this scope ifstream f("spirala.in"); ^ spirala.cpp:6:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ spirala.cpp:6:14: error: expected ';' before 'f' ifstream f("spirala.in"); ^ spirala.cpp:7:5: error: 'ofstream' was not declared in this scope ofstream g("spirala.out"); ^ spirala.cpp:7:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from spirala.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ spirala.cpp:7:14: error: expected ';' before 'g' ofstream g("spirala.out"); ^ spirala.cpp:9:2: error: 'f' was not declared in this scope f>>n; ^ spirala.cpp:17:4: error: 'g' was not declared in this scope g<<a[i][j]<<" "; ^ spirala.cpp:19:4: error: 'g' was not declared in this scope g<<a[j][n - i + 1]<<" "; ^ spirala.cpp:21:4: error: 'g' was not declared in this scope g<<a[n - i + 1][j]<<" "; ^ spirala.cpp:23:4: error: 'g' was not declared in this scope g<<a[j][i]<<" "; ^ spirala.cpp:26:3: error: 'g' was not declared in this scope g<<a[n / 2 + 1][n / 2 + 1]; ^ spirala.cpp:27:5: error: 'g' was not declared in this scope g.close(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Spirala 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ă.