#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 | #64121936 | Utilizator | |
| Fișier | nrprime.cpp | Dimensiune | 469 B |
| Data încărcării | 18 Aprilie 2026, 15:17 | Scor/rezultat | Eroare de compilare |
nrprime.cpp: In function ‘int prime(int)’: nrprime.cpp:5:1: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 5 | if (n<2) | ^~ nrprime.cpp:7:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 7 | for(int d=2; d*d,=n; d++) | ^~~ nrprime.cpp:7:22: error: expected primary-expression before ‘=’ token 7 | for(int d=2; d*d,=n; d++) | ^ nrprime.cpp:7:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 7 | for(int d=2; d*d,=n; d++) | ^~~ nrprime.cpp:10:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 10 | return 1; | ^~~~~~ nrprime.cpp: In function ‘int main()’: nrprime.cpp:16:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 16 | for( i=1; i<=n; i++) | ^~~ nrprime.cpp:19:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 19 | for( i=2; i<=n; i+2) | ^~~ nrprime.cpp:19:26: warning: for increment expression has no effect [-Wunused-value] 19 | for( i=2; i<=n; i+2) | ~^~
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ă.