Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
516 B
11
Indexable
Never
#include<stdio.h>

char word;
long long int a,b;

long long int plus(long long int a,long long int b){
	return a+b;
}

long long int sub(long long int a,long long int b){
	return a-b;
}

long long int multi(long long int a,long long int b){
	return a*b;
}

int main(){
	while(scanf("%c",&word)!=EOF){
		getchar();
		scanf("%lld%lld",&a,&b);
		getchar();
		long long int ans;
		if(word=='+'){
			ans=plus(a,b);
		}
		else if(word=='-'){
			ans=sub(a,b);
		}
		else{
			ans=multi(a,b);
		}
		printf("%lld\n",ans);
	}
}