#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 |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #46431844 | Utilizator | |
| Fișier | maxmin.cpp | Dimensiune | 415 B |
| Data încărcării | 13 Noiembrie 2023, 20:40 | Scor/rezultat | Eroare de compilare |
maxmin.cpp: In function 'int main()': maxmin.cpp:10:19: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<maxi=a; ^ maxmin.cpp:10:19: 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:12:19: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<maxi=b; ^ maxmin.cpp:12:19: 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:19: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<maxi=c; ^ maxmin.cpp:14:19: 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:19: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<mini=a; ^ maxmin.cpp:16:19: 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:19: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<mini=b; ^ maxmin.cpp:18:19: 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:20:19: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int') cout<<mini=c; ^ maxmin.cpp:20:19: 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>&'
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ă.