#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 | #51457565 | Utilizator | |
Fișier | af.cpp | Dimensiune | 799 B |
Data încărcării | 20 Iunie 2024, 12:11 | Scor / rezultat | Eroare de compilare |
af.cpp: In function 'int main()': af.cpp:12:11: error: expected ';' before 'nr1' cin nr1 >> semn >> nr2 >> nr3; ^ af.cpp:12:36: warning: statement has no effect [-Wunused-value] cin nr1 >> semn >> nr2 >> nr3; ^ af.cpp:13:18: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(semn == "+"){ ^ af.cpp:13:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] af.cpp:14:22: error: lvalue required as left operand of assignment if(nr1 + nr2 = nr3) ^ af.cpp:19:18: error: expected primary-expression before ')' token if(semn = -){ ^ af.cpp:20:22: error: lvalue required as left operand of assignment if(nr1 - nr2 = nr3) ^ af.cpp:25:17: error: 'x' was not declared in this scope if(semn = x){ ^ af.cpp:26:22: error: lvalue required as left operand of assignment if(nr1 * nr2 = nr3) ^ af.cpp:31:17: error: expected primary-expression before ':' token if(semn = :) { ^ af.cpp:31:17: error: expected ')' before ':' token af.cpp:32:22: error: lvalue required as left operand of assignment if(nr1 / nr2 = nr3) ^
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ă.