#1700
Scrieţi în limbajul C++
definiţia completă a subprogramului inmultire
cu următorul antet:
void inmultire(matrice_rara a, matrice_rara b, matrice_rara &c)
ce calculează în c
produsul matricelor rare a
şi b
.
Problema | produsMatriceRara | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56802978 | Utilizator | |
Fișier | produsmatricerara.cpp | Dimensiune | 2.46 KB |
Data încărcării | 06 Martie 2025, 10:51 | Scor / rezultat | Eroare de compilare |
produsmatricerara.cpp:30:8: error: redefinition of 'struct matrice_rara' struct matrice_rara ^ produsmatricerara.cpp:9:8: error: previous definition of 'struct matrice_rara' struct matrice_rara { ^ produsmatricerara.cpp:37:4: error: invalid type in declaration before ',' token } a, b, c; ^ produsmatricerara.cpp: In function 'int main()': produsmatricerara.cpp:94:7: error: request for member 'nr_linii' in 'a', which is of non-class type 'int' a.nr_linii = 3; ^ produsmatricerara.cpp:95:7: error: request for member 'nr_coloane' in 'a', which is of non-class type 'int' a.nr_coloane = 3; ^ produsmatricerara.cpp:96:7: error: request for member 'nr_triplete' in 'a', which is of non-class type 'int' a.nr_triplete = 3; ^ produsmatricerara.cpp:97:7: error: request for member 't' in 'a', which is of non-class type 'int' a.t[0] = {1, 1, 1}; // [1, 0, 0] ^ produsmatricerara.cpp:98:7: error: request for member 't' in 'a', which is of non-class type 'int' a.t[1] = {1, 2, 2}; // [0, 2, 0] ^ produsmatricerara.cpp:99:7: error: request for member 't' in 'a', which is of non-class type 'int' a.t[2] = {3, 3, 3}; // [0, 0, 3] ^ produsmatricerara.cpp:102:7: error: request for member 'nr_linii' in 'b', which is of non-class type 'int' b.nr_linii = 3; ^ produsmatricerara.cpp:103:7: error: request for member 'nr_coloane' in 'b', which is of non-class type 'int' b.nr_coloane = 3; ^ produsmatricerara.cpp:104:7: error: request for member 'nr_triplete' in 'b', which is of non-class type 'int' b.nr_triplete = 3; ^ produsmatricerara.cpp:105:7: error: request for member 't' in 'b', which is of non-class type 'int' b.t[0] = {1, 1, 4}; // [4, 0, 0] ^ produsmatricerara.cpp:106:7: error: request for member 't' in 'b', which is of non-class type 'int' b.t[1] = {2, 2, 5}; // [0, 5, 0] ^ produsmatricerara.cpp:107:7: error: request for member 't' in 'b', which is of non-class type 'int' b.t[2] = {3, 3, 6}; // [0, 0, 6] ^ produsmatricerara.cpp:110:22: error: could not convert 'a' from 'int' to 'matrice_rara' inmultire(a, b, c); ^ produsmatricerara.cpp: In function 'int main()': produsmatricerara.cpp:117:5: error: redefinition of 'int main()' int main() { ^ produsmatricerara.cpp:91:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema produsMatriceRara face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.