#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 | #50731365 | Utilizator | |
Fișier | maxmin.cpp | Dimensiune | 311 B |
Data încărcării | 25 Aprilie 2024, 21:59 | Scor / rezultat | Eroare de compilare |
maxmin.cpp: In function 'int main()': maxmin.cpp:7:25: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long int') if (a<b && b<c) cout<<mm=c-a; ^ maxmin.cpp:7:25: note: candidate is: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, 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 int' to 'const std::basic_ostream<char>&' maxmin.cpp:8:30: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long int') else if (a<c && c<b) cout<<mm=b-a; ^ maxmin.cpp:8:30: note: candidate is: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, 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 int' to 'const std::basic_ostream<char>&' maxmin.cpp:9:30: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long int') else if (b<a && a<c) cout<<mm=c-b; ^ maxmin.cpp:9:30: note: candidate is: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, 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 int' to 'const std::basic_ostream<char>&' maxmin.cpp:10:30: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long int') else if (b<c && c<a) cout<<mm=a-b; ^ maxmin.cpp:10:30: note: candidate is: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, 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 int' to 'const std::basic_ostream<char>&' maxmin.cpp:11:30: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long int') else if (c<b && b<a) cout<<mm=a-c; ^ maxmin.cpp:11:30: note: candidate is: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, 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 int' to 'const std::basic_ostream<char>&' maxmin.cpp:12:30: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long int') else if (c<a && a<b) cout<<mm=b-c; ^ maxmin.cpp:12:30: note: candidate is: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, 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 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ă.