#666
Se dă o matrice cu n linii și m coloane și elemente numere naturale. Să se determine câte dintre elementele situate pe linii cu indici pari sunt prime.
| Problema | NrPrime | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64611004 | Utilizator | |
| Fișier | nrprime.cpp | Dimensiune | 471 B |
| Data încărcării | 18 Mai 2026, 15:52 | Scor/rezultat | 0 puncte |
nrprime.cpp: In function ‘int main()’: nrprime.cpp:6:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(int i=1;i<=n;i++) | ^~~ nrprime.cpp:9:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 9 | for(int i=2;i<=n;i=i+2){ | ^~~ nrprime.cpp:15:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 15 | for( int d=2;d*d<=x;d++) | ^~~ nrprime.cpp:18:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 18 | if(ok==1) | ^~ nrprime.cpp:8:20: warning: array subscript 101 is above array bounds of ‘int [101][101]’ [-Warray-bounds=] 8 | cin>>a[101][101]; | ~~~~~~~~~~^ nrprime.cpp:4:9: note: while referencing ‘a’ 4 | int a[101][101],m,n,cnt=0; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.005 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrPrime 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ă.