#4689
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, n];[1, n];| Problema | GenMat31 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64550079 | Utilizator | |
| Fișier | genmat31.cpp | Dimensiune | 588 B |
| Data încărcării | 13 Mai 2026, 19:01 | Scor/rezultat | Eroare de compilare |
genmat31.cpp:2:7: error: expected nested-name-specifier before ‘namsepace’ 2 | using namsepace std; | ^~~~~~~~~ genmat31.cpp: In function ‘int main()’: genmat31.cpp:6:1: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 6 | cin>>n; | ^~~ | std::cin In file included from genmat31.cpp:1: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ genmat31.cpp:36:2: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 36 | cout<<a[i][j]<<" "; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ genmat31.cpp:38:2: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 38 | cout<<endl; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ genmat31.cpp:38:8: error: ‘endl’ was not declared in this scope; did you mean ‘std::endl’? 38 | 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) | ^~~~ genmat31.cpp:41:3: error: expected ‘}’ at end of input 41 | } | ^ genmat31.cpp:17:22: note: to match this ‘{’ 17 | for(int i=2;i<=n;i++){ | ^ genmat31.cpp:41:3: error: expected ‘}’ at end of input 41 | } | ^ genmat31.cpp:5:1: note: to match this ‘{’ 5 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat31 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ă.