#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 | #53954942 | Utilizator | |
Fișier | eval_exp2.cpp | Dimensiune | 1.19 KB |
Data încărcării | 15 Noiembrie 2024, 18:41 | Scor / rezultat | Eroare de compilare |
eval_exp2.cpp:12:9: error: stray '\342' in program if(s[i]==’)’) ^ eval_exp2.cpp:12:9: error: stray '\200' in program eval_exp2.cpp:12:9: error: stray '\231' in program eval_exp2.cpp:12:9: error: stray '\342' in program eval_exp2.cpp:12:9: error: stray '\200' in program eval_exp2.cpp:12:9: error: stray '\231' in program eval_exp2.cpp:15:13: error: stray '\342' in program if(s[i]==’(’) ^ eval_exp2.cpp:15:13: error: stray '\200' in program eval_exp2.cpp:15:13: error: stray '\231' in program eval_exp2.cpp:15:13: error: stray '\342' in program eval_exp2.cpp:15:13: error: stray '\200' in program eval_exp2.cpp:15:13: error: stray '\231' in program eval_exp2.cpp:26:9: error: stray '\342' in program numar=numar*10+(s[i]-’0’); ^ eval_exp2.cpp:26:9: error: stray '\200' in program eval_exp2.cpp:26:9: error: stray '\231' in program eval_exp2.cpp:26:9: error: stray '\342' in program eval_exp2.cpp:26:9: error: stray '\200' in program eval_exp2.cpp:26:9: error: stray '\231' in program eval_exp2.cpp:31:5: error: stray '\342' in program int poz=cautas(st,dr,’+’,’-’); ^ eval_exp2.cpp:31:5: error: stray '\200' in program eval_exp2.cpp:31:5: error: stray '\231' in program eval_exp2.cpp:31:5: error: stray '\342' in program eval_exp2.cpp:31:5: error: stray '\200' in program eval_exp2.cpp:31:5: error: stray '\231' in program eval_exp2.cpp:31:5: error: stray '\342' in program eval_exp2.cpp:31:5: error: stray '\200' in program eval_exp2.cpp:31:5: error: stray '\231' in program eval_exp2.cpp:31:5: error: stray '\342' in program eval_exp2.cpp:31:5: error: stray '\200' in program eval_exp2.cpp:31:5: error: stray '\231' in program eval_exp2.cpp:36:9: error: stray '\342' in program if(s[poz]==’+’) ^ eval_exp2.cpp:36:9: error: stray '\200' in program eval_exp2.cpp:36:9: error: stray '\231' in program eval_exp2.cpp:36:9: error: stray '\342' in program eval_exp2.cpp:36:9: error: stray '\200' in program eval_exp2.cpp:36:9: error: stray '\231' in program eval_exp2.cpp:40:5: error: stray '\342' in program poz=cautas(st,dr,’*’,’-/’); ^ eval_exp2.cpp:40:5: error: stray '\200' in program eval_exp2.cpp:40:5: error: stray '\231' in program eval_exp2.cpp:40:5: error: stray '\342' in program eval_exp2.cpp:40:5: error: stray '\200' in program eval_exp2.cpp:40:5: error: stray '\231' in program eval_exp2.cpp:40:5: error: stray '\342' in program eval_exp2.cpp:40:5: error: stray '\200' in program eval_exp2.cpp:40:5: error: stray '\231' in program eval_exp2.cpp:40:5: error: stray '\342' in program eval_exp2.cpp:40:5: error: stray '\200' in program eval_exp2.cpp:40:5: error: stray '\231' in program eval_exp2.cpp:45:9: error: stray '\342' in program if(s[poz]==’*’) ^ eval_exp2.cpp:45:9: error: stray '\200' in program eval_exp2.cpp:45:9: error: stray '\231' in program eval_exp2.cpp:45:9: error: stray '\342' in program eval_exp2.cpp:45:9: error: stray '\200' in program eval_exp2.cpp:45:9: error: stray '\231' in program eval_exp2.cpp:49:5: error: stray '\342' in program if(s[st]==’(’ && s[dr]==’)’) ^ eval_exp2.cpp:49:5: error: stray '\200' in program eval_exp2.cpp:49:5: error: stray '\231' in program eval_exp2.cpp:49:5: error: stray '\342' in program eval_exp2.cpp:49:5: error: stray '\200' in program eval_exp2.cpp:49:5: error: stray '\231' in program eval_exp2.cpp:49:5: error: stray '\342' in program eval_exp2.cpp:49:5: error: stray '\200' in program eval_exp2.cpp:49:5: error: stray '\231' in program eval_exp2.cpp:49:5: error: stray '\342' in program eval_exp2.cpp:49:5: error: stray '\200' in program eval_exp2.cpp:49:5: error: stray '\231' in program eval_exp2.cpp: In function 'int cautas(int, int, char, char)': eval_exp2.cpp:12:21: error: expected primary-expression before ')' token if(s[i]==’)’) ^ eval_exp2.cpp:12:25: error: expected primary-expression before ')' token if(s[i]==’)’) ^ eval_exp2.cpp:12:25: error: expected ';' before ')' token eval_exp2.cpp:15:29: error: expected primary-expression before ')' token if(s[i]==’(’) ^ eval_exp2.cpp:16:25: error: expected ')' before 'nr' nr--; ^ eval_exp2.cpp: In function 'int solve(int, int)': eval_exp2.cpp:31:33: error: expected primary-expression before ',' token int poz=cautas(st,dr,’+’,’-’); ^ eval_exp2.cpp:31:41: error: expected primary-expression before ')' token int poz=cautas(st,dr,’+’,’-’); ^ eval_exp2.cpp:36:27: error: expected primary-expression before ')' token if(s[poz]==’+’) ^ eval_exp2.cpp:40:29: error: expected primary-expression before ',' token poz=cautas(st,dr,’*’,’-/’); ^ eval_exp2.cpp:40:34: error: expected primary-expression before '/' token poz=cautas(st,dr,’*’,’-/’); ^ eval_exp2.cpp:40:38: error: expected primary-expression before ')' token poz=cautas(st,dr,’*’,’-/’); ^ eval_exp2.cpp:45:27: error: expected primary-expression before ')' token if(s[poz]==’*’) ^ eval_exp2.cpp:49:27: error: expected ')' before '[' token if(s[st]==’(’ && s[dr]==’)’) ^ eval_exp2.cpp:50:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] return solve(st+1,dr-1); ^ eval_exp2.cpp:50:32: error: expected ')' before ';' token return solve(st+1,dr-1); ^ eval_exp2.cpp:49:26: error: label 's' used but not defined if(s[st]==’(’ && s[dr]==’)’) ^
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ă.