View Code of Problem 3855

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
	int n;
	cin>>n;
	while(n--){
		int a,b;
		char c;
		scanf("%d%c%d",&a,&c,&b);
		if(c=='+'){
			cout<<a+b<<endl;
		}else if(c=='-'){
			cout<<a-b<<endl;
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3855