#9
maxmin
Să se scrie un program care citeşte de la tastatură trei numere naturale și determină diferenţa dintre cel mai mare şi cel mai mic.
Problema | maxmin | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54052591 | Utilizator | |
Fișier | maxmin.cpp | Dimensiune | 318 B |
Data încărcării | 18 Noiembrie 2024, 19:24 | Scor / rezultat | Eroare de compilare |
maxmin.cpp: In function 'int main()': maxmin.cpp:12:15: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<max=b; ^ maxmin.cpp:12:15: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from maxmin.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>&' maxmin.cpp:14:18: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<max=c; ^ maxmin.cpp:14:18: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from maxmin.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>&' maxmin.cpp:16:18: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<min=b; ^ maxmin.cpp:16:18: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from maxmin.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>&' maxmin.cpp:18:20: error: found ':' in nested-name-specifier, expected '::' cout<<min=c: ^ maxmin.cpp:18:19: error: 'c' is not a class, namespace, or enumeration cout<<min=c: ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maxmin 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ă.