![]() |
#1 |
![]()
.
. . #include <iostream> using namespace std; int main () { } , , . . float x; - float y; - float r; - char o; - . cin cin >> x; cin >> o; cin >> y; , switch (o) { case '+': r = x + y; break; case '-': r = x - y; break; case '*': r = x * y; break; case '/': r = x / y; break; } , , . cout << "You result : " << x << " " << o << " " << y << " = " << r << endl; While , . #include <iostream> using namespace std; int main() { float x; float y; float r; char o; while(true) { cin >> x; cin >> o; cin >> y; switch (o) { case '+': r = x + y; break; case '-': r = x - y; break; case '*': r = x * y; break; case '/': r = x / y; break; } cout << "You result : " << x << " " << o << " " << y << " = " << r << endl; } } |
|
![]() |
![]() |
![]() |
#2 | |
![]() :
![]() |
||
![]() |
![]() |
![]() |
#3 | |
![]() :
![]() |
||
![]() |
![]() |
![]() |
#4 |
![]() |
|
![]() |
![]() |
![]() |
#5 |
![]()
! !
|
|
![]() |
![]() |
![]() |
#6 |
![]()
.
|
|
![]() |
![]() |
![]() |
#7 |
![]() |
|
![]() |
![]() |
![]() |
#8 |
![]()
,
|
|
![]() |
![]() |
![]() |
#9 |
![]()
.
|
|
![]() |
![]() |
![]() |
#10 |
![]() |
|
![]() |
![]() |