#2638
Se consideră o expresie corectă formată din numere naturale și operatorii +, -, *. Să se evalueze expresia.
| Problema | eval_exp | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63545261 | Utilizator | |
| Fișier | eval_exp.cpp | Dimensiune | 621 B |
| Data încărcării | 09 Martie 2026, 08:20 | Scor/rezultat | Eroare de compilare |
eval_exp.cpp: In function 'long long int expresie(int&)': eval_exp.cpp:13:15: warning: unused variable 'ret' [-Wunused-variable] long long ret=0; ^ eval_exp.cpp:14:9: warning: unused variable 'sgn' [-Wunused-variable] int sgn=1; ^ eval_exp.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ eval_exp.cpp: In function 'long long int factor(int&)': eval_exp.cpp:36:19: error: invalid type argument of unary '*' (have 'int') sgn=*-1; ^ eval_exp.cpp:39:11: error: cannot resolve overloaded function 'isdigit' based on conversion to type 'bool' while(isdigit) ^ eval_exp.cpp:40:1: error: expected primary-expression before '}' token } ^ eval_exp.cpp:40:1: error: expected ';' before '}' token eval_exp.cpp:31:15: warning: unused variable 'ret' [-Wunused-variable] long long ret=factor(p); ^ eval_exp.cpp:40:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema eval_exp 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ă.