#4506
Se dau trei numere întregi a b c
. Să se determine cea mai mare valoare care se poate obține prin înmulțirea a două dintre numere și adunarea rezultatului cu al treilea.
Problema | SumProd1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56148496 | Utilizator | |
Fișier | sumprod1.cpp | Dimensiune | 427 B |
Data încărcării | 07 Februarie 2025, 18:10 | Scor / rezultat | 30 puncte |
sumprod1.cpp: In function 'int main()': sumprod1.cpp:7:8: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] if (a==b & b==c && a==c) r=a*b+c; ^ sumprod1.cpp:8:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] else if (a==b & b>c && a>c) r=a*b+c; ^ sumprod1.cpp:9:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] else if (a==c & c>b && a>b) r=a*c+b; ^ sumprod1.cpp:10:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] else if (b==c & b>a && c>a) r=b*c+a; ^ sumprod1.cpp:11:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] else if (a>b & b>c && a>c) r=a*b+c; ^ sumprod1.cpp:12:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] else if (a>c & c>b && a>b) r=a*c+b; ^ sumprod1.cpp:13:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] else if (b>c & b>a && c>a) r=b*c+a; ^ sumprod1.cpp:14:13: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] else if (c>b & b>a && c>a) r=b*c+a; ^ sumprod1.cpp:15:10: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized] cout<<r; ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
4 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
5 | 0 secunde | OK. | 10 | 10 | ||
6 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
7 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 30 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumProd1 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ă.