Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int A,B,N,res;
- char op;
- scanf("%d",&N);
- while(N--){
- scanf("%d%c%d",&A,&op,&B);
- if(op=='+'){
- res=A-B;
- }
- else if(op=='-'){
- res=A*B;
- }
- else if(op=='*'){
- res=A+B;
- }
- else if(op=='/'){
- res=A/B;
- }
- printf("%d\n",res);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment