#206
GenMat1
Scrieţi un program care citeşte de la tastatură două numere naturale nenule n
şi m
şi care construieşte în memorie şi apoi afişează o matrice A
cu n
linii (numerotate de la 1
la n
) şi m
coloane (numerotate de la 1
la m
) cu proprietatea că fiecare element A
ij
memorează cea mai mică dintre valorile indicilor i
şi j
.
Variante Bacalaureat 2009
Problema | GenMat1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53087236 | Utilizator | |
Fișier | genmat1.cpp | Dimensiune | 294 B |
Data încărcării | 17 Octombrie 2024, 11:27 | Scor / rezultat | Eroare de compilare |
genmat1.cpp: In function 'int main()': genmat1.cpp:6:5: error: 'cin' was not declared in this scope cin>>n>>m; ^ genmat1.cpp:6:5: note: suggested alternative: In file included from genmat1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ genmat1.cpp:9:28: error: 'min' was not declared in this scope a[i][j]=min(i,j); ^ genmat1.cpp:9:28: note: suggested alternative: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from genmat1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: 'std::min' min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ genmat1.cpp:13:9: error: 'cout' was not declared in this scope cout<<a[i][j]<<" "; ^ genmat1.cpp:13:9: note: suggested alternative: In file included from genmat1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ genmat1.cpp:14:9: error: 'cout' was not declared in this scope cout<<endl; ^ genmat1.cpp:14:9: note: suggested alternative: In file included from genmat1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ genmat1.cpp:14:15: error: 'endl' was not declared in this scope cout<<endl; ^ genmat1.cpp:14:15: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from genmat1.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 GenMat1 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ă.