#1395
Se dau două matrice cu elemente numere întregi. Calculați suma lor.
| Problema | MSuma | Operații I/O |
msuma.in/msuma.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64493729 | Utilizator | |
| Fișier | msuma.cpp | Dimensiune | 555 B |
| Data încărcării | 11 Mai 2026, 09:48 | Scor/rezultat | Eroare de compilare |
msuma.cpp:5:14: error: ‘msuma’ was not declared in this scope 5 | ifstream cin(msuma.in) | ^~~~~ msuma.cpp:6:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 6 | ofstream cout(msuma.out) | ^~~~~~~~ msuma.cpp:8:17: error: declaration of ‘A’ as multidimensional array must have bounds for all dimensions except the first 8 | void citire(int A[][]; int n; int m) | ^ msuma.cpp:8:22: error: expected ‘)’ before ‘;’ token 8 | void citire(int A[][]; int n; int m) | ~ ^ | ) msuma.cpp:8:36: error: expected initializer before ‘)’ token 8 | void citire(int A[][]; int n; int m) | ^ msuma.cpp:9:17: error: ‘i’ does not name a type 9 | for(int i=1;i<=n;i++) | ^ msuma.cpp:9:22: error: ‘i’ does not name a type 9 | for(int i=1;i<=n;i++) | ^ msuma.cpp:10:20: error: ‘j’ does not name a type 10 | for (int j;j<=m;j++) | ^ msuma.cpp:10:25: error: ‘j’ does not name a type 10 | for (int j;j<=m;j++) | ^ msuma.cpp: In function ‘int main()’: msuma.cpp:13:13: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 13 | { cin>>n>>m>>p>>q; | ^ | tm msuma.cpp:13:16: error: ‘p’ was not declared in this scope 13 | { cin>>n>>m>>p>>q; | ^ msuma.cpp:13:19: error: ‘q’ was not declared in this scope 13 | { cin>>n>>m>>p>>q; | ^ msuma.cpp:14:12: error: ‘A’ was not declared in this scope 14 | citire(A,n,m); | ^ msuma.cpp:15:12: error: ‘B’ was not declared in this scope 15 | citire(B,p,q); | ^ msuma.cpp:19:17: error: ‘S’ was not declared in this scope 19 | S[i][j]=A[i][j]+B[i][j]; | ^ msuma.cpp:20:17: error: ‘cout’ was not declared in this scope 20 | cout<<S[i][j]} | ^~~~ msuma.cpp:4:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? 3 | #include <fstream> +++ |+#include <iostream> 4 | using namespace std; msuma.cpp:21:13: error: ‘cout’ was not declared in this scope 21 | cout<<"\n";}} | ^~~~ msuma.cpp:21:13: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MSuma 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ă.