Detalii evaluare #53954859

Rezumat problemă

#3549 eval_exp2 C++

Se consideră o expresie corectă formată din numere naturale, paranteze rotunde și operatorii +, -, *. Să se evalueze expresia.

Detalii

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 #53954859 Utilizator Iarca Ștefan (Iarca_Stefan)
Fișier eval_exp2.cpp Dimensiune 1.21 KB
Data încărcării 15 Noiembrie 2024, 18:38 Scor / rezultat Eroare de compilare

Evaluare


Mesaj 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(int, 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]==’)’)

                          ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema eval_exp2 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.