#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <conio.h>

using namespace std;

int calc(int, int, string);

int main() {	
	
	int num1, num2, total;
	string oper;	

	cout << "Please enter first integer number: ";
	cin >> num1;
	
	cout << "Please enter second integer number: ";
	cin >> num2;
	
	cout << "Please enter operator: ";
	cin >> oper;
	
	if (oper.compare("plus") == 0 || 
		oper.compare("minus") == 0 ||
		oper.compare("multiply") == 0 ||
		oper.compare("divide") == 0) 
	{	
		total = calc(num1, num2, oper);
		cout << num1 << " "<< oper << " " << num2 << " = " << total << endl;
	}
	else
	{
		cout << "Operator: " << oper << " not supported!" ;
	}
	return 0;
}

int calc(int num1, int num2, string oper)
{	
	int total;
	
	if (oper.compare("plus") == 0) 
	{
		total = num1 + num2;
		return total;	
	}
	
	if (oper.compare("minus") == 0)
	{
		total = num1 + num2;
		return total;	
	}	

	if (oper.compare("multiply") == 0) {
		total = num1 * num2;
		return total;	
	}
	
	if (oper.compare("divide") == 0) 
	{
		total = num1 / num2;
		return total;	
	}
}
