#774
Se dă o matrice cu n linii şi m coloane şi elemente numere naturale. Să se elimine din matrice toate liniile care încep cu un număr prim și apoi să se afișeze matricea.
| Problema | ElimLinii | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64888736 | Utilizator | |
| Fișier | elimlinii.cpp | Dimensiune | 513 B |
| Data încărcării | 09 Iunie 2026, 18:45 | Scor/rezultat | Eroare de compilare |
elimlinii.cpp: In function ‘int main()’: elimlinii.cpp:14:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 14 | for(int i=1;i<=n;i++) | ^~~ elimlinii.cpp:17:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 17 | if(a[i][1]<2) | ^~ elimlinii.cpp:15:13: warning: unused variable ‘prim’ [-Wunused-variable] 15 | int prim=1; | ^~~~ elimlinii.cpp:17:14: error: ‘i’ was not declared in this scope 17 | if(a[i][1]<2) | ^ elimlinii.cpp:18:13: error: ‘prim’ was not declared in this scope 18 | prim=0; | ^~~~ elimlinii.cpp:20:12: error: ‘prim’ was not declared in this scope 20 | if(prim==0) | ^~~~ elimlinii.cpp:22:25: error: ‘i’ was not declared in this scope 22 | cout<<a[i][j]<<" "; | ^ elimlinii.cpp:20:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 20 | if(prim==0) | ^~ elimlinii.cpp:23:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 23 | cout<<"\n"; | ^~~~ elimlinii.cpp: At global scope: elimlinii.cpp:25:5: error: expected declaration before ‘}’ token 25 | } | ^ elimlinii.cpp:27:5: error: expected unqualified-id before ‘return’ 27 | return 0; | ^~~~~~ elimlinii.cpp:28:1: error: expected declaration before ‘}’ token 28 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ElimLinii 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ă.