#812
Scrieţi un program care citeşte de la tastatură un număr natural n şi construieşte în memorie o matrice cu n linii şi n coloane în care:
1;[1, n];Variante Bacalaureat 2012
| Problema | GenMat19 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64670763 | Utilizator | |
| Fișier | genmat19.cpp | Dimensiune | 414 B |
| Data încărcării | 21 Mai 2026, 16:26 | Scor/rezultat | Eroare de compilare |
genmat19.cpp:2:7: error: expected nested-name-specifier before ‘naespace’ 2 | using naespace std; | ^~~~~~~~ genmat19.cpp: In function ‘int main()’: genmat19.cpp:6:5: error: expected initializer before ‘cin’ 6 | cin>>n; | ^~~ genmat19.cpp:9:1: error: ‘a’ was not declared in this scope 9 | a[i][1]=1; | ^ genmat19.cpp:13:1: error: ‘a’ was not declared in this scope 13 | a[n][j]=j; | ^ genmat19.cpp:19:5: error: ‘a’ was not declared in this scope 19 | a[i][j]=a[i][j-1]+a[i+1][j]; | ^ genmat19.cpp:26:1: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 26 | cout<<a[i][j]<<" "; | ^~~~ | std::cout In file included from genmat19.cpp:1: /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ genmat19.cpp:26:7: error: ‘a’ was not declared in this scope 26 | cout<<a[i][j]<<" "; | ^ genmat19.cpp:28:1: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 28 | cout<<endl; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ genmat19.cpp:28:7: error: ‘endl’ was not declared in this scope; did you mean ‘std::endl’? 28 | cout<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/13/iostream:41: /usr/include/c++/13/ostream:735:5: note: ‘std::endl’ declared here 735 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat19 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ă.