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<vector>
#include<string>
#include<cstdlib>
using namespace std;

int main(void){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		string a, b;
		cin >> a >> b;
		if(a.size()>80 || b.size()>80) {cout << "overflow" << endl;}
		else{
			vector<int> x, y, z;
			for(int j=0; j<80; j++){
				x.push_back(0);
				y.push_back(0);
				z.push_back(0);
			}

			for(int j=0; j<a.size(); j++)
				x[j] = atoi( a.substr(a.size()-1-j,1).c_str() );
			for(int j=0; j<b.size(); j++)
				y[j] = atoi( b.substr(b.size()-1-j,1).c_str() );
			
			for(int j=0; j<80; j++){
				z[j] = x[j]+y[j];
			}
			for(int j=0; j<79; j++){
				if( z[j]>=10 ){
					z[j+1]++;
					z[j]-=10;
				}
			}
			if(z[79]>=10) {cout << "overflow" << endl;}
			else {
				bool zeroume = false;
				for(int j=0; j<80; j++){
					if(z[79-j]==0 && zeroume==false){}
					else{cout << z[79-j];zeroume=true;}
				}
				if(zeroume==false) cout << 0;
				cout << endl;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
using namespace std;
typedef pair<int,int> P;
const int INF = ~(1<<31) / 2;

int main(){
    int k;
    cin >> k;
    for(int j=0;j<k;j++){
        int n[80];
        string a,b;
        cin >> a >> b;
        int n_a = a.size(),n_b = b.size();
        if(n_a>80||n_b>80){cout << "overflow" << endl;continue;}

        fill(n,n+80,0);
        bool is_over = false;
        for(int i=0;i<max(n_a,n_b);i++){
            int ai,bi;
            if (i<n_a) ai = a[n_a-i-1]-'0';
            else ai = 0;
            if (i<n_b) bi = b[n_b-i-1]-'0';
            else bi = 0;
            n[i] += ai + bi;
            if (n[i]>=10){
                if(i+1 == 80){
                    is_over = true;
                    break;
                }else{
                    n[i+1] += n[i]/10;
                    n[i] = n[i]%10;
                }
            }
        }
        if (is_over){
            cout << "overflow" << endl;
        }else{
            bool started = false;
            for(int i=79;i>=0;i--){
                if(!started && n[i]>0){
                    started = true;
                }
                if(started){
                    cout << n[i];
                }
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>

using namespace std;

int A[90],B[90],C[90];

int main()
{
    int n;
    cin >> n;
    while(n > 0)
    {
        n--;
        string str1,str2;
        cin >> str1 >> str2;
        int len1 = str1.length();
        int len2 = str2.length();
        if(len1 < len2)
        {
            string st = str1;
            str1 = str2;
            str2 = st;
            int ll = len1;
            len1 = len2;
            len2 = ll;
        }
        for(int i = 0; i < 90; i++)
            C[i] = 0;
        for(int i = 0; i < len1; i++)
            A[i] = str1[len1 - 1 - i] - '0';
        for(int i = 0; i < len2; i++)
            B[i] = str2[len2 - 1 - i] - '0';
        for(int i = 0 ; i < len2; i++)
        {
            C[i] = (A[i] + B[i]) % 10;
            C[i+1] = (A[i] + B[i]) / 10;
        }
        for(int i = len2; i <len1; i++)
        {
             C[i] = C[i] + A[i];
             C[i+1] = C[i] / 10;
             C[i] = C[i] % 10;
        }


        if(C[80] > 0)
            cout << "overflow" << endl;
        else
            {
                if(C[len1] > 0)
                    len1++;
                for(int i = len1-1; i >= 0; i--)
                    cout << C[i];
                cout << endl;
            }
    }
    return 0;
}

C++: #include <iostream>
#include <string.h>
#include <algorithm>

using namespace std;
void add(string& ans,string& a,string& b);
int main() {
	string a,b;
	int al,bl;
	int n;
	cin>>n;
	while(n--){
	        string ans= "";
		cin>>a>>b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		al=a.size();
		bl=b.size();
		if(bl>al){
			swap(a,b);
			swap(al,bl);
		}
		for(int i=0;i<(al-bl);i++){
			b+='0';
		}
		add(ans,a,b);
		if(ans.size()>80) ans="overflow";
		else{
		  reverse(ans.begin(),ans.end());
		}
	  	cout<<ans<<endl;
	}
	return 0;
}
void add(string& ans,string& a,string& b){
	int x,y=0;
	for(int i= 0;i<a.size();i++){
		x=a[i]-'0'+b[i]-'0';
		if(x>=10){
			ans+= (x%10)+'0';
			y=1;
		}else{
			ans+= x+y+'0';
			y=0;
		}
	}
	if(y==1)ans+='1';
}