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>

using namespace std;

int main()
{
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        string s1, s2;

        cin >> s1 >> s2;
        if (s1.size() > 80 || s2.size() > 80)
            cout << "overflow" << endl;
        else {
            int i1 = s1.size();
            int i2 = s2.size();
            string ans;
            int tmp = 0;
            int up = 0;

            for ( ; (i1 > 0) && (i2 > 0); i1--, i2-- ) {
                tmp = (s1[i1 - 1] + s2[i2 - 1]) - 2 * '0' + up;
                up = tmp / 10;
                tmp %= 10;
                ans = char(tmp + '0') + ans;
            }
            
            if (i1 > 0) {
                for ( ; i1 > 0; i1--) {
                    tmp = s1[i1 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }
            else if (i2 > 0) {
                for ( ; i2 > 0; i2--) {
                    tmp = s2[i2 - 1] - '0' + up;
                    up = tmp / 10;
                    tmp %= 10;
                    ans = char(tmp + '0') + ans;
                }
            }

            if (up > 0)
                ans = char(up + '0') + ans;

            if (ans.size() > 80)
                cout << "overflow" << endl;
            else
                cout << ans << endl;
        }
    }

    return 0;
}

C++: #include <array>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

typedef array<int, 11> BigInt;

string BigInt2String(BigInt bi) {
  reverse(bi.begin(), bi.end());
  char buf[89] = {};
  char *pos = buf;
  for (auto i : bi) {
    sprintf(pos, "%08d", i);
    pos += 8;
  }
  string result(buf);
  return result.substr(result.find_first_not_of('0'));
}
  
BigInt String2BigInt(const string& s) {
  BigInt bi { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };

  string t(s);
  int i = 0;
  while (!t.empty()) {
    size_t offset = t.size() < 8 ? 0 : t.size() - 8;
    bi[i++] = atoi(t.substr(offset).c_str());
    t = t.substr(0, offset);
  }
  return bi;
}

string AddBig(const string& x, const string& y) {
  if (x.size() > 80 || y.size() > 80) { return string("overflow"); }

  BigInt x_bi = String2BigInt(x);
  BigInt y_bi = String2BigInt(y);
  BigInt sum { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
  for (int i = 0; i < x_bi.size(); ++i) {
    sum[i] += x_bi[i] + y_bi[i];
    if (sum[i] > 99999999) {
      sum[i + 1] = 1;
      sum[i] -= 100000000;
    }
  }
  if (sum[10] != 0) { return string("overflow"); }
  return BigInt2String(sum);
}
  
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string x, y;
    cin >> x;
    cin >> y;
    cout << AddBig(x, y) << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
#define MAX 1000
#define temp 85
int main(){
	int x,A[MAX],B[MAX],al,bl,sum[MAX],pre,now;
	char a[MAX],b[MAX];
	cin>>x;
	while(x-->0){
		for(int i=0;i<MAX;i++){
			A[i]=0;
			B[i]=0;
			sum[i]=0;
		}
		cin>>a;
		cin>>b;
		al=strlen(a);
		bl=strlen(b);
		for(int i=0;i<al;i++)
		A[i]=a[al-1-i]-'0';
		for(int i=0;i<bl;i++)
		B[i]=b[bl-1-i]-'0';
		if(al>bl)
		bl=al;
		pre=0;
		for(int i=0;i<=bl;i++){
			if(A[i]+B[i]+pre>9)
				now=1;
			else now=0;
			sum[i]=(A[i]+B[i]+pre)%10;
			pre=now;
		}
		if(sum[bl]!=0){
		for(int i=bl;i>=0;i--)
		cout<<sum[i];
		}
		else {
		for(int i=bl-1;i>=0;i--)
		cout<<sum[i];
		}
		cout<<endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
for(int b=0;b<a;b++){
    int goukei[81]{};
    char c[110]{},d[110]{};
    scanf("%s%s",c,d);
    int e,f;
    e=strlen(c);f=strlen(d);
    if(e>80||f>80)puts("overflow");
   else{ e--;f--;
    for(int g=80;g!=0;g--,e--,f--){
	int s=goukei[g];
	if(e>-1)s+=c[e]-48;
	if(f>-1)s+=d[f]-48;
	goukei[g-1]=s/10;
	goukei[g]=s%10;
	}
	if(goukei[0])puts("overflow");
	else{
	    bool ss=false;
	    for(int m:goukei){
		if(m)ss=true;
		if(ss)printf("%d",m);
		}
		puts("");
	    }}
    }
}