#2422
Se citesc mai multe numere naturale nenule. Fiecare astfel de număr X
se va afișa, urmat de un triplet de numere a b c
cu proprietatea că a+b+c=X
, iar produsul lor este maxim.
Problema | ProdusMaxim | Operații I/O |
![]() produsmaxim.in /produsmaxim.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0 MB
|
Id soluție | #57386151 | Utilizator | |
Fișier | produsmaxim.cpp | Dimensiune | 478 B |
Data încărcării | 28 Martie 2025, 12:49 | Scor / rezultat | Eroare de compilare |
produsmaxim.cpp: In function 'int main()': produsmaxim.cpp:12:39: warning: left shift count >= width of type [enabled by default] E << X << ' ' << a=X/3 << ' ' << b=X/3 << ' ' << c=X/3 <<'\n'; ^ produsmaxim.cpp:12:55: warning: left shift count >= width of type [enabled by default] E << X << ' ' << a=X/3 << ' ' << b=X/3 << ' ' << c=X/3 <<'\n'; ^ produsmaxim.cpp:12:63: error: lvalue required as left operand of assignment E << X << ' ' << a=X/3 << ' ' << b=X/3 << ' ' << c=X/3 <<'\n'; ^ produsmaxim.cpp:14:39: warning: left shift count >= width of type [enabled by default] E << X << ' ' << a=X/3 << ' ' << b=X/3 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:14:55: warning: left shift count >= width of type [enabled by default] E << X << ' ' << a=X/3 << ' ' << b=X/3 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:14:67: warning: suggest parentheses around '+' inside '<<' [-Wparentheses] E << X << ' ' << a=X/3 << ' ' << b=X/3 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:14:63: error: lvalue required as left operand of assignment E << X << ' ' << a=X/3 << ' ' << b=X/3 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:15:42: warning: left shift count >= width of type [enabled by default] else E << X << ' ' << a=X/3 << ' ' << b=X/3+1 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:15:60: warning: left shift count >= width of type [enabled by default] else E << X << ' ' << a=X/3 << ' ' << b=X/3+1 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:15:54: warning: suggest parentheses around '+' inside '<<' [-Wparentheses] else E << X << ' ' << a=X/3 << ' ' << b=X/3+1 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:15:72: warning: suggest parentheses around '+' inside '<<' [-Wparentheses] else E << X << ' ' << a=X/3 << ' ' << b=X/3+1 << ' ' << c=X/3+1 <<'\n'; ^ produsmaxim.cpp:15:68: error: lvalue required as left operand of assignment else E << X << ' ' << a=X/3 << ' ' << b=X/3+1 << ' ' << c=X/3+1 <<'\n'; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ProdusMaxim 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ă.