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