#2422
ProdusMaxim
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 | #54791234 | Utilizator | |
Fișier | produsmaxim.cpp | Dimensiune | 419 B |
Data încărcării | 08 Decembrie 2024, 21:49 | Scor / rezultat | Eroare de compilare |
produsmaxim.cpp:12:26: error: empty character constant if (x%3==0)g<<x<<'' ''<<x/3<<'' ''<<x/3<<'' ''<<x/3; ^ produsmaxim.cpp:12:29: error: empty character constant if (x%3==0)g<<x<<'' ''<<x/3<<'' ''<<x/3<<'' ''<<x/3; ^ produsmaxim.cpp:12:38: error: empty character constant if (x%3==0)g<<x<<'' ''<<x/3<<'' ''<<x/3<<'' ''<<x/3; ^ produsmaxim.cpp:12:41: error: empty character constant if (x%3==0)g<<x<<'' ''<<x/3<<'' ''<<x/3<<'' ''<<x/3; ^ produsmaxim.cpp:12:50: error: empty character constant if (x%3==0)g<<x<<'' ''<<x/3<<'' ''<<x/3<<'' ''<<x/3; ^ produsmaxim.cpp:12:53: error: empty character constant if (x%3==0)g<<x<<'' ''<<x/3<<'' ''<<x/3<<'' ''<<x/3; ^ produsmaxim.cpp:13:39: error: empty character constant else if (x%3==1)g<<x<<'' '' <<x/3<<'' ''<<x/3<<'' ''<<(x/3)+1; ^ produsmaxim.cpp:13:42: error: empty character constant else if (x%3==1)g<<x<<'' '' <<x/3<<'' ''<<x/3<<'' ''<<(x/3)+1; ^ produsmaxim.cpp:13:52: error: empty character constant else if (x%3==1)g<<x<<'' '' <<x/3<<'' ''<<x/3<<'' ''<<(x/3)+1; ^ produsmaxim.cpp:13:55: error: empty character constant else if (x%3==1)g<<x<<'' '' <<x/3<<'' ''<<x/3<<'' ''<<(x/3)+1; ^ produsmaxim.cpp:13:64: error: empty character constant else if (x%3==1)g<<x<<'' '' <<x/3<<'' ''<<x/3<<'' ''<<(x/3)+1; ^ produsmaxim.cpp:13:67: error: empty character constant else if (x%3==1)g<<x<<'' '' <<x/3<<'' ''<<x/3<<'' ''<<(x/3)+1; ^ produsmaxim.cpp:14:32: error: empty character constant else g<<x<<'' ''<<x/3<<'' ''<<(x/3)+1<<'' ''<<x/3)+1; ^ produsmaxim.cpp:14:35: error: empty character constant else g<<x<<'' ''<<x/3<<'' ''<<(x/3)+1<<'' ''<<x/3)+1; ^ produsmaxim.cpp:14:44: error: empty character constant else g<<x<<'' ''<<x/3<<'' ''<<(x/3)+1<<'' ''<<x/3)+1; ^ produsmaxim.cpp:14:47: error: empty character constant else g<<x<<'' ''<<x/3<<'' ''<<(x/3)+1<<'' ''<<x/3)+1; ^ produsmaxim.cpp:14:60: error: empty character constant else g<<x<<'' ''<<x/3<<'' ''<<(x/3)+1<<'' ''<<x/3)+1; ^ produsmaxim.cpp:14:63: error: empty character constant else g<<x<<'' ''<<x/3<<'' ''<<(x/3)+1<<'' ''<<x/3)+1; ^ produsmaxim.cpp: In function 'int main()': produsmaxim.cpp:12:29: error: expected ';' before '\x0' if (x%3==0)g<<x<<'' ''<<x/3<<'' ''<<x/3<<'' ''<<x/3; ^ produsmaxim.cpp:13:42: error: expected ';' before '\x0' else if (x%3==1)g<<x<<'' '' <<x/3<<'' ''<<x/3<<'' ''<<(x/3)+1; ^ produsmaxim.cpp:14:35: error: expected ';' before '\x0' else g<<x<<'' ''<<x/3<<'' ''<<(x/3)+1<<'' ''<<x/3)+1; ^ produsmaxim.cpp:10:7: warning: unused variable 'a' [-Wunused-variable] int x,a,b,c; ^ produsmaxim.cpp:10:9: warning: unused variable 'b' [-Wunused-variable] int x,a,b,c; ^ produsmaxim.cpp:10:11: warning: unused variable 'c' [-Wunused-variable] int x,a,b,c; ^
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ă.