Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int a,b,d = 1;
- cout << "Введите a и b через пробел: ";
- cin >> a >> b;
- cout << "Выберите действие: " << endl
- << "1. " << a << " + " << b << endl
- << "2. " << a << " - " << b << endl
- << "3. " << a << " * " << b << endl
- << "4. " << a << " / " << b << endl;
- cin >> d;
- cout << "\n\nРезультат: ";
- switch(d){
- case 1:
- cout << a+b;
- break;
- case 2:
- cout << a-b;
- break;
- case 3:
- cout << a*b;
- break;
- case 4:
- cout << (float)a/b;
- break;
- default:
- cout << "Не знаю такого действия :c \n Перезапустите программу и попробуйте снова";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement