Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <sstream>
using namespace std;

int main()
{

    int ResultArray[50][101];
    int ArraySize[50];
    int DataSet;

    cin >> DataSet;
    int Loop = 0;
    while(Loop < DataSet)
    {
        string StringFirstNumber;
        string StringSecondNumber;
        int FirstArray[101];
        int SecondArray[101];
        char CharFirstNumber[100];
        char CharSecondNumber[100];
        int A;
        int B;
        vector<int> FirstNumber;
        vector<int> SecondNumber;
        vector<int> Result;

        cin >> StringFirstNumber;
        cin >> StringSecondNumber;
        //Convert string-int

        for(unsigned int x = 0; x < StringFirstNumber.length(); x++)
        {
            CharFirstNumber[x] = StringFirstNumber[x];
            A = CharFirstNumber[x] - '0';
            FirstNumber.push_back(A);
        }

        for(unsigned int y = 0; y < StringSecondNumber.length(); y++)
        {
            CharSecondNumber[y] = StringSecondNumber[y];
            B = CharSecondNumber[y] - '0';
            SecondNumber.push_back(B);
        }

        //Reverse Array
        reverse(FirstNumber.begin(),FirstNumber.end());
        reverse(SecondNumber.begin(),SecondNumber.end());

        //Give 0 to Result
        int Size1 = FirstNumber.size();
        int Size2 = SecondNumber.size();

        if(FirstNumber.size() > SecondNumber.size())
        {
            for( int a = 0; a < (Size1 - Size2); a++)
            {
                SecondNumber.push_back(0);
            }

            Size2 = Size1;
        }
        else
        {
            for( int b = 0; b < (Size2 - Size1); b++)
            {
                FirstNumber.push_back(0);
            }

            Size1 = Size2;
        }

        //Convert to Array
        for( int c = 0; c < Size1; c++)
        {
            FirstArray[c] = FirstNumber[c];

        }

        for( int d = 0; d < Size2; d++)
        {
            SecondArray[d] = SecondNumber[d];
        }

        //Addition
        for( int e = 0; e < Size1; e++)
        {
            ResultArray[Loop][e] = FirstArray[e] + SecondArray[e];
        }

        ResultArray[Loop][Size1] = 0;


        //Add 1 to next digit
        for( int f = 0; f < Size2+1; f++)
        {
            if(ResultArray[Loop][f] >= 10)
            {
                ResultArray[Loop][f] -= 10;
                ResultArray[Loop][f+1]++;
            }
        }

        //Reverse Result
        for(int i = 0; i < Size1+1; i++)
        {
            Result.push_back(ResultArray[Loop][i]);
        }

        reverse(Result.begin(),Result.end());
        //Store Result

        if(Result[0] == 0)
        {
            for(unsigned int g = 1; g < Result.size(); g++)
            {
                ResultArray[Loop][g-1] = Result[g];

            }
            ArraySize[Loop] = Result.size()-1;

        }
        else
        {
            for(unsigned int h = 0; h < Result.size(); h++)
            {
                ResultArray[Loop][h] = Result[h];
            }
            ArraySize[Loop] = Result.size();

        }
    Loop++;
    }

    cout << endl;
    
    for(int Last = 0; Last < DataSet; Last++)
    {
        //Print Answer
        for(int Last1 = 0; Last1 < ArraySize[Last]; Last1++)
        {
            cout << ResultArray[Last][Last1];
        }
        cout << endl;
        if(ArraySize[Last] >= 80)
        {
            cout << "overflow" << endl;
        }
    }

}