#3549
eval_exp2
C++
Se consideră o expresie corectă formată din numere naturale, paranteze rotunde și operatorii +
, -
, *
. Să se evalueze expresia.
Problema | eval_exp2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50182347 | Utilizator | |
Fișier | eval_exp2.cpp | Dimensiune | 757 B |
Data încărcării | 30 Martie 2024, 10:57 | Scor / rezultat | Eroare de compilare |
eval_exp2.cpp: In function 'int main()': eval_exp2.cpp:16:15: error: 'expresie' was not declared in this scope expresie(i); ^ eval_exp2.cpp:17:11: error: 'ans' was not declared in this scope fout<<ans<<'\n'; ^ eval_exp2.cpp: In function 'int factor(int&)': eval_exp2.cpp:28:23: warning: NULL used in arithmetic [-Wpointer-arith] while(s[poz]!=NULL && s[poz]>='0' && s[poz]<='9') ^ eval_exp2.cpp:34:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ eval_exp2.cpp: In function 'int expresie(int&)': eval_exp2.cpp:39:22: error: 'termen' was not declared in this scope int t1=termen(poz); ^ eval_exp2.cpp:40:19: warning: NULL used in arithmetic [-Wpointer-arith] while(s[poz]!=NULL) ^ eval_exp2.cpp: In function 'int termen(int&)': eval_exp2.cpp:51:9: warning: unused variable 'f1' [-Wunused-variable] int f1=factor(poz); ^ eval_exp2.cpp:52:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema eval_exp2 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ă.