#2641
AF
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 | #51457597 | Utilizator | |
Fișier | af.cpp | Dimensiune | 855 B |
Data încărcării | 20 Iunie 2024, 12:19 | Scor / rezultat | Eroare de compilare |
af.cpp: In function 'int main()': af.cpp:16:18: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(semn == "+"){ ^ af.cpp:16:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] af.cpp:17:22: error: lvalue required as left operand of assignment if(nr1 + nr2 = nr3){ ^ af.cpp:22:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] if(semn = "-"){ ^ af.cpp:22:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(semn = "-"){ ^ af.cpp:23:22: error: lvalue required as left operand of assignment if(nr1 - nr2 = nr3){ ^ af.cpp:28:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] if(semn = "x"){ ^ af.cpp:28:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(semn = "x"){ ^ af.cpp:29:22: error: lvalue required as left operand of assignment if(nr1 * nr2 = nr3){ ^ af.cpp:34:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] if(semn = ":") { ^ af.cpp:34:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(semn = ":") { ^ af.cpp:35:22: error: lvalue required as left operand of assignment if(nr1 / nr2 = nr3){ ^ af.cpp:41:1: error: expected '}' at end of input } ^ af.cpp:41:1: error: expected '}' at end of input af.cpp:41:1: error: expected '}' at end of input af.cpp:41:1: error: expected '}' at end of input
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ă.