#include "stdafx.h"
#include "iostream"
using namespace std;
//alidoran
int main()
{
int x, y,z;
char op;
cout << "enter you operation (like 1+2)"<<endl;
cin >> x >> op >> y;
if (op == '*') z = 0;
if (op == '+') z = 1;
if (op == '-') z = 2;
if (op == '/') z = 3;
if (op == '%') z = 4;
switch (z)
{
case 0: cout << x*y; break;
case 1:cout << x + y; break;
case 2:cout << x - y; break;
case 3:cout << x / y; break;
case 4:cout << x % y; break;
}
cout << endl;
system("pause");
return 0;
}
- ۹۶/۱۱/۱۸