Răspuns :
Răspuns:
#include <iostream>
#include <cmath>
using namespace std;
int a,b;
char c;
int main()
{
cin>>a>>c>>b;
if(c=='+')
cout<<a+b;
else if(c=='-')
cout<<a-b;
else if(c=='*')
cout<<1LL*a*b;
else if(c=='/')
cout<<(double)a/b;
else if(c=='%')
cout<<a%b;
return 0;
}
Răspuns:
#include <iostream>
using namespace std;
int main()
{
int a, b;
char op;
cin >> a >> op >> b;
if (op == '+')
cout << a + b;
if (op == '-')
cout << a - b;
if (op == '*')
cout << a * b;
if (op == '/')
cout << (float)a/b;
return 0;
}