Language: C

#include <iostream>
using namespace std;

int const MAX = 11;
typedef int DataType;

void Error(const string& s)
{
    cout << s;
}
struct Stack
{
    DataType data[MAX];
    int top;
    int length;
};

Stack a;
Stack b;
Stack r;
char op;

void InitStack(Stack *s)
{
    s->top = -1;
}

bool StackEmpty(Stack *s)
{
    return s->top == -1;
}

bool StackFull(Stack *s)
{
    return s->top == MAX - 1;
}

void Push(Stack *s, int i)
{
    if(StackFull(s))
    {
        Error("Stack underflow");
        return;
    }
    s->data[++s->top] = i;
}

int Sizeof(Stack *s)
{
    return s->top + 1;
}

DataType Pop(Stack *s)
{
    if(StackEmpty(s))
    {
        return 0;
    }
    return s->data[s->top--];
}

DataType StackTop(Stack *s)
{
    if(StackEmpty(s))
    {
        return 0;
    }
    return s->data[s->top];
}

int char2int(char c)
{
    return c-'0';
}

void printStack(Stack* result)
{
    bool start = false;
    while(!StackEmpty(result))
    {
        if(StackTop(result) == 0) {
            if(start) {
                cout << Pop(result);
            } else {
                Pop(result);
            }
        } else {
            if(!start) {
                start = true;
            }
            cout << Pop(result);
        }
    }
    cout << endl;
}


void input()
{
    Stack *p = &a;
    // input a, b
    int index = 0;
    char c;
    cin.get(c);
    while( c != '\n' ) {
        if( c == ' ') {
            cin.get(c);
            if(c == '+' || c == '-') {
                op = c;
                p = &b;
            }
            cin.get(c);
        } else {
            Push(p, char2int(c));
        }
        cin.get(c);
    }
}

void compute(char & op, Stack* left, Stack* right, Stack* result)
{
    int local_a, local_b, local_r, local_add = 0;
    if(op == '+') {
        op = NULL;
        for(int i=0; i<MAX; ++i) {
            if (StackEmpty(left)) {
                local_a = 0;
            } else {
                local_a = Pop(left);
            }
            if (StackEmpty(right)) {
                local_b = 0;
            } else {
                local_b = Pop(right);
            }
            local_r = (local_a + local_b + local_add) % 10;
            local_add = (local_a + local_b + local_add) / 10;
            Push(result, local_r);
        }
    }
    else if(op == '-') {
        op = NULL;
        if( Sizeof(left) < Sizeof(right) ||
           Sizeof(left) == Sizeof(right) && StackTop(left) < StackTop(right) )
        {
            op = '-';
            // 19 - 110 or 31 - 52
            for(int i=0; i<MAX; ++i) {
                local_a = Pop(right);
                local_b = Pop(left);
                if (local_a - local_add - local_b < 0) {
                    local_a += 10;
                    local_r = local_a - local_add - local_b;
                    local_add = 1;
                } else {
                    local_r = local_a - local_b - local_add;
                    local_add = 0;
                }
                Push(result, local_r);
            }
        } else {
            for(int i=0; i<MAX; ++i) {
                local_a = Pop(left);
                local_b = Pop(right);
                if (local_a - local_add - local_b < 0) {
                    local_a += 10;
                    local_r = local_a - local_add - local_b;
                    local_add = 1;
                } else {
                    local_r = local_a - local_b - local_add;
                    local_add = 0;
                }
                Push(result, local_r);
            }
        }
    }
}
int main()
{
    InitStack(&a);
    InitStack(&b);
    InitStack(&r);
    input();
    compute(op, &a, &b, &r);
    if(op) cout << op;
    printStack(&r);
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.