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 "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int N; cin >> N;
	while (N--) {

		string a, b; cin >> a >> b;
		if (a.size() >= 81 || b.size() >= 81)continue;
		vector<int>v(101);
		for (int i = 0; i < a.size(); ++i) {
			v[101 - a.size() + i] = a[i] - '0';
		}
		for (int i = 0; i < b.size(); ++i) {
			v[101 - b.size() + i] += b[i] - '0';
		}
		for (int i = 100; i > 0; --i) {
			if (v[i] >= 10) {
				v[i - 1]++;
				v[i] -= 10;
			}
		}
		int num = 0;
		num = find_if(v.begin(), v.end(), [](const int a) {return a; })-v.begin();
		if (num <= 20)cout << "overflow" << endl;
		else {
			for (int i = num; i < 101; ++i) {
				cout << v[i];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#define MAX 80

#include <string>

using namespace std;

int main()
{
	int n;
	cin >> n;
	for (int counter = 0; counter < n; counter++){
		string a, b;
		cin >> a >> b;
		if (a.length() > MAX || b.length() > MAX){
			cout << "overflow" << endl;
			continue;
		}
		int inta[MAX + 2], intb[MAX + 2], sum[MAX + 2];
		fill(inta, inta + MAX + 2, 0);
		fill(intb, intb + MAX + 2, 0);
		fill(sum, sum + MAX + 2, 0);
		for (int i = 0; i < (signed)a.length(); i++){
			inta[i] = a[a.length() - i - 1] - '0';
		}
		for (int i = 0; i < (signed)b.length(); i++){
			intb[i] = b[b.length() - i - 1] - '0';
		}
		
		int over = 0;
		for (int i = 0; i < MAX + 2; i++){
			sum[i] = inta[i] + intb[i] + over;
			if (sum[i] >= 10){
				sum[i] -= 10;
				over = 1;
			}
			else{
				over = 0;
			}
		}

		for (int i = MAX + 1;; i--){
			if (sum[i] != 0){
				if (i >= MAX){
					cout << "overflow" << endl;
					break;
				}
				for (int j = i; j >= 0; j--){
					cout << sum[j];
				}
				cout << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int N; cin >> N;
	for (int i = 0; i < N;i++) {
		string str1, str2;
		cin >> str1 >> str2;
		int f = 0;	//????????°?????????
		if (str1.length() > str2.length()) {
			string temp(str1.length() - str2.length() + 1,'0');
			str1 = '0' + str1;
			str2 = temp + str2;
		}
		else if (str1.length() < str2.length()) {
			string temp(str2.length() - str1.length() + 1, '0');
			str1 = temp + str1;
			str2 = '0' + str2;
		}
		string ans((int)str1.length(),'0');
		for (int i = str1.length()-1 ; i >= 0;i--) {
			int dig1 = str1[i] - '0', dig2 = str2[i] - '0';
			if (f + dig1 + dig2 >= 10) {
				ans[i] = (f + dig1 + dig2) % 10 +'0';
				f = 1;
			}
			else {
				ans[i] = (f + dig1 + dig2) + '0';
				f = 0;
			}
		}
		int size = ans.length();
		if (ans[0] == '0') size--;
		if (size > 80)cout << "overflow" << endl;
		else {
			if (ans[0] == '0') {
				cout << ans.substr(1,size) << endl;
			}
			else {
				cout << ans << endl;
			}
		}
	}
}

C++: #include<stdio.h>
#include<string.h>
char a[1000],b[1000];
int c[1000];
int main()
{
    int n,k;
    scanf("%d",&n);
   // getchar();
    while(n--)
    {
        memset(a,'\0',sizeof(a));
        memset(b,'\0',sizeof(b));
        memset(c,0,sizeof(c));
        scanf("%s %s",a,b);
        int i,j,la,lb,k;
        la=strlen(a)-1;
        lb=strlen(b)-1;
        for(i=0; la>=0; i++,la--)
            c[i]+=a[la]-'0';
        for(i=0; lb>=0; i++,lb--)
        {
            c[i]+=b[lb]-'0';
            if(c[i]>=10)
            {
                c[i]-=10;
                c[i+1]+=1;
            }
        }
        while(c[i]!=0)
        {
            if(c[i]>=10)
            {
                c[i]-=10;
                c[i+1]+=1;

            }
            i++;
        }
        i--;
        if(i>=80)
            printf("overflow\n");
        else
        {
            for(k=i; k>=0; k--)
                if(c[k]!=0)
                    break;
            if(k==-1)
                printf("0");
            else
            {
                for(j=k; j>=0; j--)
                    printf("%d",c[j]);
            }
            printf("\n");
        }
    }
    return 0;
}