#4689
GenMat31
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 | #52953399 | Utilizator | |
Fișier | genmat31.cpp | Dimensiune | 337 B |
Data încărcării | 14 Octombrie 2024, 09:50 | Scor / rezultat | Eroare de compilare |
genmat31.cpp: In function 'int main()': genmat31.cpp:6:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++)a[i][1]=i; ^ genmat31.cpp:7:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++)a[1][i]=i; ^ genmat31.cpp:8:16: error: 'n' was not declared in this scope for(i=2;i<=n;i++) ^ genmat31.cpp:11:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ genmat31.cpp:13:24: error: 'cout' was not declared in this scope for(j=1;j<=n;j++)cout<<a[i][j]<<" "; ^ genmat31.cpp:13:24: note: suggested alternative: In file included from genmat31.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ genmat31.cpp:14:7: error: 'cout' was not declared in this scope cout<<endl; ^ genmat31.cpp:14:7: note: suggested alternative: In file included from genmat31.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ genmat31.cpp:14:13: error: 'endl' was not declared in this scope cout<<endl; ^ genmat31.cpp:14:13: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from genmat31.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^
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ă.