#1313
Se citesc doua matrice din fisier . Sa se calculeze produsul lor .
| Problema | Produs_Matrice | Operații I/O |
produs_matrice.in/produs_matrice.out
|
|---|---|---|---|
| Limita timp | 0.05 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64554860 | Utilizator | |
| Fișier | produs_matrice.cpp | Dimensiune | 584 B |
| Data încărcării | 14 Mai 2026, 09:30 | Scor/rezultat | Eroare de compilare |
produs_matrice.cpp:4:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 4 | ofstream fout("produs_matrice.out") | ^~~~~~~~ produs_matrice.cpp: In function ‘int main()’: produs_matrice.cpp:8:10: error: ‘n’ was not declared in this scope 8 | fin>>n>>m; | ^ produs_matrice.cpp:8:13: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 8 | fin>>n>>m; | ^ | tm produs_matrice.cpp:11:14: error: ‘a’ was not declared in this scope 11 | fin>>a[i][j]; | ^ produs_matrice.cpp:9:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 9 | for(int i=1;i<=n;i++) | ^~~ produs_matrice.cpp:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 12 | fin>>p; | ^~~ produs_matrice.cpp:12:14: error: ‘p’ was not declared in this scope 12 | fin>>p; | ^ produs_matrice.cpp:15:14: error: ‘b’ was not declared in this scope 15 | fin>>b[i][j]; | ^ produs_matrice.cpp:20:9: error: ‘c’ was not declared in this scope 20 | c[i][j]=0; | ^ produs_matrice.cpp:22:22: error: ‘a’ was not declared in this scope 22 | c[i][j]+=a[i][k]*b[k][j]; | ^ produs_matrice.cpp:22:30: error: ‘b’ was not declared in this scope 22 | c[i][j]+=a[i][k]*b[k][j]; | ^ produs_matrice.cpp:24:5: error: ‘fout’ was not declared in this scope 24 | fout<<c[i][j]<<'\n'; | ^~~~ produs_matrice.cpp:24:11: error: ‘c’ was not declared in this scope 24 | fout<<c[i][j]<<'\n'; | ^ produs_matrice.cpp:24:16: error: ‘j’ was not declared in this scope 24 | fout<<c[i][j]<<'\n'; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Produs_Matrice 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ă.