View Code of Problem 3855

#include <stdio.h>

int main()
{
        int t;
        scanf("%d",&t);
        while(t--)
        {
                int a,b;
                char op;
                scanf("%d%c%d",&a,&op,&b);
                if(op=='+')
                        printf("%d\n",a+b);
                else if(op=='-')
                        printf("%d\n",a-b);
                else
                        printf("ERROR\n");
        }

}

Double click to view unformatted code.


Back to problem 3855