#3665
Se dă un număr natural n. Determinaţi cea mai mare cifră pară a sa. Dacă numărul nu are cifre pare se va afişa numărul 10.
| Problema | cmmcp | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64775798 | Utilizator | |
| Fișier | cmmcp.cpp | Dimensiune | 308 B |
| Data încărcării | 29 Mai 2026, 15:08 | Scor/rezultat | 100 puncte |
cmmcp.cpp: In function ‘int main()’: cmmcp.cpp:7:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 7 | if (n==0) | ^~ cmmcp.cpp:9:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 9 | while(n!=0) | ^~~~~ cmmcp.cpp:11:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] 11 | if(n%2==0 & n%10>maxi) | ~~~^~~ cmmcp.cpp:11:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | if(n%2==0 & n%10>maxi) | ^~ cmmcp.cpp:13:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 13 | n=n/10; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | ||
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.002 secunde | OK. | 20 | 20 | ||
| 5 | 0.002 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cmmcp 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ă.