Ответ:
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
double a, b;
cin >> a;
char o = ' ';
while (o == ' ' || o == '\n') {
cin >> o;
}
cin >> b;
if (o == '+') cout << a + b;
else if (o == '-') cout << a - b;
else if (o == '*') cout << a * b;
else if (o == '/') cout << a / b;
else cout << "ERROR";
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
double a, b;
cin >> a;
char o = ' ';
while (o == ' ' || o == '\n') {
cin >> o;
}
cin >> b;
if (o == '+') cout << a + b;
else if (o == '-') cout << a - b;
else if (o == '*') cout << a * b;
else if (o == '/') cout << a / b;
else cout << "ERROR";
}