Joisino wants to evaluate the formula "A op B". Here, A and B are integers, and the binary operator op is either +
or -
. Your task is to evaluate the formula instead of her.
- 1≦A,B≦109
- op is either
+
or-
.
The input is given from Standard Input in the following format:
A op BOutput
Evaluate the formula and print the result.
Sample Input 11 + 2Sample Output 1
3
Since 1+2=3, the output should be 3.
Sample Input 25 - 7Sample Output 2
-2wa了一次,输入上需加注意!
AC:
#include<stdio.h>
int main(){
int a,b;
char s;
scanf("%d\n",&a);
scanf("%c",&s);
scanf("%d",&b);
if(s=='+')
printf("%d\n",a+b);
else
printf("%d\n",a-b);
return 0;
}