#78
Scrieți definiția completă subprogramului C++ citmat care citește de la tastatură dimensiunile și elementele unui tablou bidimensional.
| Problema | FCitireMatrice | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64697275 | Utilizator | |
| Fișier | fcitirematrice.cpp | Dimensiune | 225 B |
| Data încărcării | 24 Mai 2026, 15:08 | Scor/rezultat | Eroare de compilare |
fcitirematrice.cpp: In function ‘int citmat(int (*)[101], int, int)’: fcitirematrice.cpp:10:1: warning: no return statement in function returning non-void [-Wreturn-type] 10 | } | ^ fcitirematrice.cpp: At global scope: fcitirematrice.cpp:11:5: error: cannot declare ‘::main’ to be a global variable 11 | int main | ^~~~ fcitirematrice.cpp:13:5: error: expected primary-expression before ‘int’ 13 | int a[100][100], n, m; | ^~~ fcitirematrice.cpp:13:5: error: expected ‘}’ before ‘int’ fcitirematrice.cpp:12:1: note: to match this ‘{’ 12 | { | ^ fcitirematrice.cpp:14:5: error: ‘cin’ does not name a type 14 | cin>>citmat(a, n, m); | ^~~ fcitirematrice.cpp:15:1: error: expected declaration before ‘}’ token 15 | } | ^ fcitirematrice.cpp:18:10: error: ‘int main()’ redeclared as different kind of entity 18 | int main(){ | ^ fcitirematrice.cpp:11:5: note: previous declaration ‘int main’ 11 | int main | ^~~~ fcitirematrice.cpp: In function ‘int main()’: fcitirematrice.cpp:20:16: error: cannot convert ‘int (*)[100]’ to ‘int (*)[101]’ 20 | citmat(a,n,m); | ^ | | | int (*)[100] fcitirematrice.cpp:4:16: note: initializing argument 1 of ‘int citmat(int (*)[101], int, int)’ 4 | int citmat(int a[101][101], int n, int m) | ~~~~^~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FCitireMatrice 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ă.