#9
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 |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #11820027 | Utilizator | |
Fișier | maxmin.cpp | Dimensiune | 349 B |
Data încărcării | 10 Noiembrie 2018, 21:14 | Scor / rezultat | Eroare de compilare |
maxmin.cpp: In function 'int main()': maxmin.cpp:7:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int') if(a>b&&a>c&&b>c) cout << a-c=mm; ^ maxmin.cpp:7:34: 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 'long long int' to 'const std::basic_ostream<char>&' maxmin.cpp:8:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int') if(a>b&&a>c&&c>b) cout << a-b=mm; ^ maxmin.cpp:8:34: 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 'long long int' to 'const std::basic_ostream<char>&' maxmin.cpp:9:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int') if(b>c&&b>a&&c>a) cout << b-a=mm; ^ maxmin.cpp:9:34: 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 'long long int' to 'const std::basic_ostream<char>&' maxmin.cpp:10:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int') if(b>c&&b>a&&a>c) cout << b-c=mm; ^ maxmin.cpp:10:34: 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 'long long int' to 'const std::basic_ostream<char>&' maxmin.cpp:11:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int') if(c>a&&c>b&&a>b) cout << c-b=mm; ^ maxmin.cpp:11:34: 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 'long long int' to 'const std::basic_ostream<char>&' maxmin.cpp:12:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int') if(c>a&&c>b&&b>a) cout << c-a=mm; ^ maxmin.cpp:12:34: 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 'long long int' to 'const std::basic_ostream<char>&'
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ă.