#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 | #64605109 | Utilizator | |
| Fișier | nrprime.cpp | Dimensiune | 627 B |
| Data încărcării | 18 Mai 2026, 11:12 | Scor/rezultat | 0 puncte |
nrprime.cpp: In function ‘int main()’: nrprime.cpp:8:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 8 | for(i = 1; i <= n; i++) | ^~~ nrprime.cpp:11:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | for(i = 1; i <= n; i++) | ^~~ nrprime.cpp:16:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 16 | if(x < 2 ||(x > 2 && x % 2 ==0)) | ^~ nrprime.cpp:18:12: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 18 | for(d = 3; d * d <= n; d = d + 2) | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.004 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ă.