#224
Se dă o matrice cu m linii şi n coloane şi elemente numere naturale. Să se construiască un nou tablou bidimensional cu n linii şi m coloane, obţinut din primul prin rotirea acestuia în sens trigonometric cu 90 o.
Variante Bacalaureat 2009
| Problema | Rotire | Operații I/O |
rotire.in/rotire.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64643771 | Utilizator | |
| Fișier | rotire.cpp | Dimensiune | 655 B |
| Data încărcării | 20 Mai 2026, 09:47 | Scor/rezultat | Eroare de compilare |
rotire.cpp:3:25: error: no matching function for call to ‘std::basic_istream<char>::basic_istream(const char [11])’ 3 | istream fin(" rotire.in") | ^ In file included from /usr/include/c++/13/fstream:40, from rotire.cpp:1: /usr/include/c++/13/istream:703:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::basic_istream(std::basic_istream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’ 703 | basic_istream(basic_istream&& __rhs) | ^~~~~~~~~~~~~ /usr/include/c++/13/istream:703:37: note: no known conversion for argument 1 from ‘const char [11]’ to ‘std::basic_istream<char>&&’ 703 | basic_istream(basic_istream&& __rhs) | ~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/istream:696:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::basic_istream() [with _CharT = char; _Traits = std::char_traits<char>]’ 696 | basic_istream() | ^~~~~~~~~~~~~ /usr/include/c++/13/istream:696:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/13/istream:95:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::basic_istream(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]’ 95 | basic_istream(__streambuf_type* __sb) | ^~~~~~~~~~~~~ /usr/include/c++/13/istream:95:39: note: no known conversion for argument 1 from ‘const char [11]’ to ‘std::basic_istream<char>::__streambuf_type*’ {aka ‘std::basic_streambuf<char>*’} 95 | basic_istream(__streambuf_type* __sb) | ~~~~~~~~~~~~~~~~~~^~~~ rotire.cpp:4:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 4 | ofstream fout(" rotire.out") | ^~~~~~~~ rotire.cpp: In function ‘int main()’: rotire.cpp:8:10: error: ‘n’ was not declared in this scope 8 | fin>>n>>m; | ^ rotire.cpp:8:13: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 8 | fin>>n>>m; | ^ | tm rotire.cpp:11:18: error: ‘a’ was not declared in this scope 11 | fin>>a[i][j]; | ^ rotire.cpp:14:20: error: ‘b’ was not declared in this scope 14 | fin >> b[i][j]; | ^ rotire.cpp:17:13: error: ‘b’ was not declared in this scope 17 | b[n - j + 1][i] = a[i][j]; | ^ rotire.cpp:20:13: error: ‘fout’ was not declared in this scope 20 | fout<<a[i][j]<<b[i][j]<<" "; | ^~~~ rotire.cpp:20:28: error: ‘b’ was not declared in this scope 20 | fout<<a[i][j]<<b[i][j]<<" "; | ^ rotire.cpp:25:2: error: expected ‘}’ at end of input 25 | } | ^ rotire.cpp:7:1: note: to match this ‘{’ 7 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Rotire 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ă.