Problem:
Score : 100 points

Problem Statement

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.

Constraints

1≦A,B≦10^9

op is either + or -.

Input

The input is given from Standard Input in the following format:

A op B

Output

Evaluate the formula and print the result.

Sample Input 1

1 + 2

Sample Output 1

3

Since 1 + 2 = 3, the output should be 3.

Sample Input 2

5 - 7

Sample Output 2

-2

Solution in C (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
    long long int i,j,k,d,m,res,rem,sum=0,su=0,r,p;
    char a[10000],b[10000];
    while(gets(a))
    {
        for(i=0; a[i]!=' '; i++)
        {
            if(a[i]<='9' && a[i]>='0')
            {
                b[i] = a[i] - 48;
                d = i;
            }
        }
        for(i=d+4; a[i]!='\0'; i++)
        {
            if(a[i]<='9' && a[i]>='0')
            {
                b[i] = a[i] - 48;
                m = i;
            }
        }
        p = m-(d+4);
        rem = pow(10,d);
        if(d==2 || d==4 || d==7 || d==8 || d==9) {rem = rem+1;}
        res = pow(10,p);
        if(p==2 || p==4 || p==7 || p==8 || p==9) {res = res+1;}
        for(i=0; i<=d; i++)
        {
            sum = sum + (b[i]*rem);
            rem = rem/10;
        }
        for(i=d+4; i<=m; i++)
        {
            su = su + (b[i]*res);
            res = res/10;
        }
        if(a[d+2]=='+') {r=sum+su;}
        else if(a[d+2]=='-') {r=sum-su;}
        printf("%lld\n",r);
        su = 0;
        sum = 0;
        r = 0;
        res = 0;
        rem = 0;
        d = 0;
        m = 0;
        p = 0;
    }
    return 0;
}