#450
minicalc
Se citesc de la tastatură 3
numere naturale, a
, b
, c
. Să se realizeze cu a
și b
operația codificată prin numărul c
.
Problema | minicalc | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53206582 | Utilizator | |
Fișier | minicalc.cpp | Dimensiune | 252 B |
Data încărcării | 21 Octombrie 2024, 12:37 | Scor / rezultat | Eroare de compilare |
minicalc.cpp: In function 'int main()': minicalc.cpp:11:8: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (c=1)cout<<x=a+b; ^ minicalc.cpp:11:16: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'float') if (c=1)cout<<x=a+b; ^ minicalc.cpp:11:16: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from minicalc.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 'float' to 'const std::basic_ostream<char>&' minicalc.cpp:12:2: error: 'else' without a previous 'if' {else if (c=2)cout<<x=a-b; ^ minicalc.cpp:12:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses] {else if (c=2)cout<<x=a-b; ^ minicalc.cpp:12:22: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'float') {else if (c=2)cout<<x=a-b; ^ minicalc.cpp:12:22: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from minicalc.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 'float' to 'const std::basic_ostream<char>&' minicalc.cpp:13:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses] else if (c=3)cout<<x=a*b; ^ minicalc.cpp:13:21: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'float') else if (c=3)cout<<x=a*b; ^ minicalc.cpp:13:21: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from minicalc.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 'float' to 'const std::basic_ostream<char>&' minicalc.cpp:14:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses] else if (c=4)cout<<x=a/b; ^ minicalc.cpp:14:21: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'float') else if (c=4)cout<<x=a/b; ^ minicalc.cpp:14:21: note: candidate is: In file included from /usr/include/c++/4.8/iostream:39:0, from minicalc.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 'float' to 'const std::basic_ostream<char>&' minicalc.cpp:15:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses] else if (c=5)cout<<x=(b*i)+a; ^ minicalc.cpp:15:25: error: 'i' was not declared in this scope else if (c=5)cout<<x=(b*i)+a; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema minicalc 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ă.