#668
Se dă o matrice cu n linii și m coloane și elemente numere naturale. Să se determine câte perechi de linii consecutive din matrice sunt identice.
| Problema | Identice1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64380081 | Utilizator | |
| Fișier | identice1.cpp | Dimensiune | 405 B |
| Data încărcării | 04 Mai 2026, 13:28 | Scor/rezultat | Eroare de compilare |
identice1.cpp: In function ‘int main()’: identice1.cpp:9:9: error: ‘i’ was not declared in this scope 9 | for(i=1;i<=n;i++) | ^ identice1.cpp:14:9: error: ‘bol’ was not declared in this scope; did you mean ‘bool’? 14 | bol ok=0; | ^~~ | bool identice1.cpp:17:25: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 17 | if(a[i+1][j]=a[i][j]) | ~~~~~~~~~^~~~~~~~ identice1.cpp:18:17: error: ‘ok’ was not declared in this scope 18 | ok=1; | ^~ identice1.cpp:20:12: error: ‘ok’ was not declared in this scope 20 | if(ok==0) nr++; | ^~ identice1.cpp:20:19: error: ‘nr’ was not declared in this scope; did you mean ‘nt’? 20 | if(ok==0) nr++; | ^~ | nt identice1.cpp:22:11: error: ‘nr’ was not declared in this scope; did you mean ‘nt’? 22 | cout<<nr; | ^~ | nt identice1.cpp:7:25: warning: unused variable ‘nt’ [-Wunused-variable] 7 | int n,m,a[103][103],nt=0; | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Identice1 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ă.