#2641
Gigel are ca temă la matematică să precizeze valoarea de adevăr a unor expresii de forma nr1 semn nr2 = nr3, unde nr1, nr2 și nr3 sunt numere naturale, iar semn poate fi +, -, x sau : reprezintând adunarea, scăderea, înmulțirea și împărțirea. Ajutați-l pe Gigel să rezolve tema la matematică.
-
| Problema | AF | Operații I/O |
af.in/af.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64531785 | Utilizator | |
| Fișier | af.cpp | Dimensiune | 748 B |
| Data încărcării | 12 Mai 2026, 19:34 | Scor/rezultat | Eroare de compilare |
af.cpp: In function ‘int main()’: af.cpp:16:9: warning: comparison with string literal results in unspecified behavior [-Waddress] 16 | if(c1 == "+") | ~~~^~~~~~ af.cpp:16:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] af.cpp:16:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 16 | if(c1 == "+") | ^ af.cpp:21:9: warning: comparison with string literal results in unspecified behavior [-Waddress] 21 | if(c1 == "-") | ~~~^~~~~~ af.cpp:21:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] af.cpp:21:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 21 | if(c1 == "-") | ^ af.cpp:26:9: warning: comparison with string literal results in unspecified behavior [-Waddress] 26 | if(c1 == "x") | ~~~^~~~~~ af.cpp:26:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] af.cpp:26:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 26 | if(c1 == "x") | ^ af.cpp:31:9: warning: comparison with string literal results in unspecified behavior [-Waddress] 31 | if(c1 == ":" && y != 0) | ~~~^~~~~~ af.cpp:31:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] af.cpp:31:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 31 | if(c1 == ":" && y != 0) | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AF 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ă.