#include
#include<math.h>
using namespace std;
void operation(char);
int main() {
char ch;
do
{
cin>>ch;
if(ch=='+'||ch=='-'||ch=='*'||ch=='/'||ch=='%')
operation(ch);
else{
cout<<"Invalid operation. Try again."<<endl;
continue;
}
}while(ch!='X'||ch!='x');
return 0;
}
void operation(char ch)
{
int N1,N2,ans=0;
cin>>N1>>N2;
switch(ch)
{
case ‘+’: ans=N1+N2;
break;
case '-': ans=N1-N2;
break;
case '*': ans=N1*N2;
break;
case '%': ans=N1%N2;
break;
}
cout<<ans<<endl;
}
//My code is showing TLE . Unable to find another logic.