#776
Se dă o matrice cu n linii şi m coloane şi elemente numere naturale. Să se determine câte linii ale matricei au toate elementele egale.
| Problema | CntLinii | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64644985 | Utilizator | |
| Fișier | cntlinii.cpp | Dimensiune | 352 B |
| Data încărcării | 20 Mai 2026, 10:38 | Scor/rezultat | Eroare de compilare |
cntlinii.cpp: In function ‘int main()’: cntlinii.cpp:5:9: error: expected identifier before numeric constant 5 | int[101][101],m,n,i,j,c,OK; | ^~~ cntlinii.cpp:5:9: error: expected ‘]’ before numeric constant 5 | int[101][101],m,n,i,j,c,OK; | ^~~ | ] cntlinii.cpp:5:8: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 5 | int[101][101],m,n,i,j,c,OK; | ^ cntlinii.cpp:5:8: error: structured binding declaration cannot have type ‘int’ cntlinii.cpp:5:8: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’ cntlinii.cpp:5:8: error: empty structured binding declaration cntlinii.cpp:5:13: error: expected initializer before ‘[’ token 5 | int[101][101],m,n,i,j,c,OK; | ^ cntlinii.cpp:6:10: error: ‘n’ was not declared in this scope 6 | cin>>n>>m; | ^ cntlinii.cpp:6:13: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 6 | cin>>n>>m; | ^ | tm cntlinii.cpp:7:9: error: ‘i’ was not declared in this scope 7 | for(i=0;i<n;i++) | ^ cntlinii.cpp:9:13: error: ‘j’ was not declared in this scope 9 | for(j=0;j<m;j++) | ^ cntlinii.cpp:10:18: error: ‘a’ was not declared in this scope 10 | cin>>a[i][j]; | ^ cntlinii.cpp:12:7: error: ‘i’ was not declared in this scope 12 | for(i=0;i<n;i++) | ^ cntlinii.cpp:14:7: error: ‘OK’ was not declared in this scope 14 | OK=1; | ^~ cntlinii.cpp:15:11: error: ‘j’ was not declared in this scope 15 | for(j=0;j<m;j++) | ^ cntlinii.cpp:17:14: error: ‘a’ was not declared in this scope 17 | if(a[i][0]!=a[i][j]) OK=0; | ^ cntlinii.cpp:19:16: error: ‘c’ was not declared in this scope 19 | if(OK==1)c++; | ^ cntlinii.cpp:21:9: error: ‘c’ was not declared in this scope 21 | cout<<c; | ^ cntlinii.cpp:5:8: warning: unused structured binding declaration [-Wunused-variable] 5 | int[101][101],m,n,i,j,c,OK; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CntLinii 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ă.