#4757
Vi se dă o expresie de forma v=a+b sau de forma v=a*b, unde v este numele unei variabile, iar a și b sunt două numere naturale. Trebuie să evaluați rezultatul expresiei.
| Problema | sir_eval | Operații I/O |
sir_eval.in/sir_eval.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 8 MB
/
Stivă 2 MB
|
| Id soluție | #65008710 | Utilizator | |
| Fișier | sir_eval.cpp | Dimensiune | 1.03 KB |
| Data încărcării | 13 Iulie 2026, 10:31 | Scor/rezultat | 100 puncte |
sir_eval.cpp: In function ‘int main()’: sir_eval.cpp:15:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 15 | for(int i=0; i<m.size(); i++){ | ~^~~~~~~~~ sir_eval.cpp:25:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 25 | for(int i=poz+1; i<m.size(); i++){ | ~^~~~~~~~~ sir_eval.cpp:40:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 40 | for(int i=0; i<nr1.size(); i++){ | ~^~~~~~~~~~~ sir_eval.cpp:44:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 44 | for(int i=0; i<nr2.size(); i++){ | ~^~~~~~~~~~~ sir_eval.cpp:22:17: warning: unused variable ‘rez’ [-Wunused-variable] 22 | int a=0,b=0,rez,ok=0; | ^~~ sir_eval.cpp:25:13: warning: ‘poz’ may be used uninitialized [-Wmaybe-uninitialized] 25 | for(int i=poz+1; i<m.size(); i++){ | ^ sir_eval.cpp:14:9: note: ‘poz’ was declared here 14 | int poz; | ^~~ sir_eval.cpp:52:5: warning: ‘s’ may be used uninitialized [-Wmaybe-uninitialized] 52 | if(s=='+') cout << a+b; | ^~ sir_eval.cpp:23:10: note: ‘s’ was declared here 23 | char s; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 10 | 10 | ||
| 2 | 0.001 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 10 | 10 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| 5 | 0.002 secunde | OK. | 10 | 10 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| 8 | 0.001 secunde | OK. | 10 | 10 | ||
| 9 | 0.001 secunde | OK. | 10 | 10 | ||
| 10 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sir_eval 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ă.