#4332
Se dă un șir cu n elemente, numere naturale nenule. Să se determine suma dintre cel mai mic și cel mai mare element prim din șir.
| Problema | PrimMaxMin | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64090577 | Utilizator | |
| Fișier | primmaxmin.cpp | Dimensiune | 464 B |
| Data încărcării | 16 Aprilie 2026, 13:27 | Scor/rezultat | 0 puncte |
primmaxmin.cpp: In function ‘int main()’: primmaxmin.cpp:11:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | if(nr1==0 || nr1==1) | ^~ primmaxmin.cpp:13:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 13 | if(nr1%d==0) prim=0; | ^~ primmaxmin.cpp:18:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 18 | if(nr2==0 || nr2==1) | ^~ primmaxmin.cpp:20:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 20 | if(nr2%d==0) prim=0; | ^~ primmaxmin.cpp:21:6: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 21 | else | ^~~~ primmaxmin.cpp:24:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 24 | if(prim=1) | ^~ primmaxmin.cpp:24:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 24 | if(prim=1) | ~~~~^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Caught fatal signal 8 | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Caught fatal signal 8 | 20 | 0 | ||
| 3 | 0.001 secunde | Caught fatal signal 8 | 20 | 0 | ||
| 4 | 0.001 secunde | Caught fatal signal 8 | 20 | 0 | ||
| 5 | 0.002 secunde | Caught fatal signal 8 | 20 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PrimMaxMin 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ă.