#207
GenMat2
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 ale cărei elemente vor primi valori după cum urmează:
0
n
n-1
1
Variante Bacalaureat 2009
Problema | GenMat2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54071970 | Utilizator | |
Fișier | genmat2.cpp | Dimensiune | 416 B |
Data încărcării | 19 Noiembrie 2024, 10:09 | Scor / rezultat | Eroare de compilare |
genmat2.cpp:1:20: error: missing terminating > character # include <iostream ^ genmat2.cpp:2:23: error: expected unqualified-id before '>' token **********************> ^ genmat2.cpp:2:23: error: expected constructor, destructor, or type conversion before '>' token genmat2.cpp: In function 'int main()': genmat2.cpp:7:5: error: 'cin' was not declared in this scope cin >> n ; ^ genmat2.cpp:7:5: note: suggested alternative: In file included from genmat2.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ genmat2.cpp:15:13: error: 'cout' was not declared in this scope cout<<a[i][j]<<" "; ^ genmat2.cpp:15:13: note: suggested alternative: In file included from genmat2.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ genmat2.cpp:16:9: error: 'cout' was not declared in this scope cout<< endl; ^ genmat2.cpp:16:9: note: suggested alternative: In file included from genmat2.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ genmat2.cpp:16:16: error: 'endl' was not declared in this scope cout<< endl; ^ genmat2.cpp:16:16: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from genmat2.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ genmat2.cpp:6:11: warning: unused variable 'm' [-Wunused-variable] int n,m,a[101][101]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat2 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ă.