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

int main()
{
    int N,j;
    cin >> N;
    for(int i=0 ; i<N ; i++){
        int ans[81]={0};
        ans[0]=11111;
        char strA[100],strB[100];
        cin >> strA >> strB;
        if(strlen(strA)>80||strlen(strB)>80){
            cout << "overflow" << endl;
            continue;
        }
        char str1[strlen(strA)][2],str2[strlen(strB)][2];
        for(int i=0 ; i<strlen(strA) ; i++){
            str1[i][0]=strA[i];
            str1[i][1]='\0';
        }
        for(int i=0 ; i<strlen(strB) ; i++){
            str2[i][0]=strB[i];
            str2[i][1]='\0';
        }
        int a[81]={0},b[81]={0};
        a[0]=11111;
        b[0]=11111;
        j=strlen(strA)-1;
        for(int i=80 ; j>=0 ; i--){
            a[i]=atoi(str1[j]);
            j--;
        }
        j=strlen(strB)-1;
        for(int i=80 ; j>=0 ; i--){
            b[i]=atoi(str2[j]);
            j--;
        }
        for(int i=80 ; i!=0 ; i--){
            ans[i]=ans[i]+a[i]+b[i];
            if(ans[i]>=10){
                ans[i]=ans[i]-10;
                ans[i-1]++;
            }
        }
        if(ans[0]!=11111){
            cout << "overflow" << endl;
            continue;
        }
        for(int i=1 ; i<81 ; i++){
            if(ans[i]!=0){
                j=i;
                break;
            }
        }
        for(int i=j ; i<81 ; i++){
         cout << ans[i];
        }
        cout << '\n';
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	
	for(int i = 0; i < n; ++i)
	{
		string numA;
		string numB;
		cin >> numA >> numB;
		
		while(numA.size() != numB.size())
		{
			if(numA.size() < numB.size())
			{
				numA = "0" + numA;
			}
			else
			{
				numB = "0" + numB;
			}
		}
		
		numA = "0" + numA;
		numB = "0" + numB;
		
		for(int i = numA.size() - 1; i >= 0; --i)
		{
			int sum = 0;
			sum = (numA[i] - '0') + (numB[i] - '0');
			
			if(sum >= 10)
			{
				sum -= 10;
				numA[i - 1] += 1;
			}
			
			numA[i] = sum + '0';
		}
		
		if(numA.size() > 80)
		{
			cout << "overflow" << endl;
			break;
		}
		if(numA.size() == 80 && numA[0] != '0')
		{
			cout << "overflow" << endl;
			break;
		}
		
		for(int i = 0; i < numA.size(); ++i)
		{
			if(i == 0 && numA[i] == '0') continue;
			cout << numA[i];
		}
		
		cout << endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n;
	string a,b;
	cin >> n;
	while(n--) {
		cin >> a >> b;
		string ret = "";
		reverse(a.begin(),a.end()),reverse(b.begin(),b.end());
		int a_len = a.size(),b_len = b.size();
		int num = max(a_len,b_len),c = 0;
		for(int i = 0; i < num; i++) {
			if(a_len <= i || b_len <= i) c += (b_len <= i ? a[i] : b[i]) - '0';
			else c += a[i] + b[i] - '0' * 2;
			ret += c % 10 + '0';
			c /= 10;
		}
		if(c) ret += c + '0';
		reverse(ret.begin(),ret.end());
		cout << (ret.size() > 80 ? "overflow" : ret) << endl;
	}
	return 0;
}

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

int main()
{
	int N;
	cin>>N;
	while(N--)
	{
		string s1,s2;
		cin>>s1>>s2;
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		int r = 0;
		string res = "";
		for(int c=0;c<max(s1.size(),s2.size());c++)
		{
			int s = r;
			r = 0;
			if(c < s1.size()) s += s1[c] -'0';
			if(c < s2.size()) s+= s2[c] - '0';

			r = s/10;
			s%=10;
			res = string(1,s+'0')+res;

		}
		if(r)
		{
			res = string(1,r+'0')+res;
		}
		cout<<(res.size() <= 80?res:"overflow")<<endl;
	}
}