#4716
Dat un număr n
trist să se transforme în cel mai mic număr vesel strict mai mare decât n
.
Concurs selectie clasa a 9-a Centru de Excelenta in Informatica - 2024 - Vaslui
Problema | vesel2 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53019544 | Utilizator | |
Fișier | vesel2.cpp | Dimensiune | 255 B |
Data încărcării | 15 Octombrie 2024, 18:19 | Scor / rezultat | Eroare de compilare |
vesel2.cpp: In function 'int main()': vesel2.cpp:11:8: error: expected '(' before 'v' v=(n/10%2==0)&(n%2); ^ vesel2.cpp:12:11: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<n=v; ^ vesel2.cpp:12:11: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from vesel2.cpp:1: /usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted> class basic_ostream : virtual public basic_ios<_CharT, _Traits> ^ /usr/include/c++/4.8/ostream:58:11: note: no known conversion for argument 1 from 'int' to 'const std::basic_ostream<char>&' vesel2.cpp:13:4: error: 'else' without a previous 'if' else ^ vesel2.cpp:16:12: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<n=t; ^ vesel2.cpp:16:12: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from vesel2.cpp:1: /usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted> class basic_ostream : virtual public basic_ios<_CharT, _Traits> ^ /usr/include/c++/4.8/ostream:58:11: note: no known conversion for argument 1 from 'int' to 'const std::basic_ostream<char>&'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema vesel2 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ă.