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"
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 c = 0;	//????????°?????????
		if (max(str1.length(), str2.length()) > 80) {
			cout << "overflow" << endl;
			continue;
		}
		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 (c + dig1 + dig2 >= 10) {
				ans[i] = (c + dig1 + dig2) % 10 + '0';
				c = (c + dig1 + dig2) / 10;
			}
			else {
				ans[i] = (c + dig1 + dig2) + '0';
				c = (c + dig1 + dig2) / 10;
			}
		}
		int size = ans.length();
		if (ans[0] == '0') size--;
		if (size > 80)cout << "overflow" << endl;
		else {
			if (ans[0] == '0') {
				cout << ans.substr(1) << endl;
			}
			else {
				cout << ans << endl;
			}
		}
	}
}

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

using namespace std;

int main() {

	string a;
	string b;
	int kari;

	cin >> kari;

	for (int o = 0; o < kari; o++) {
		int c[80] = {0};
		int d[80] = {0};
		int e[81] = {0};
		int counter;

		cin >> a;
		cin >> b;
	
		if (a.size() > 80 || b.size() > 80) {
			cout << "overflow" << endl;
		} else {
			for (int i = a.size() - 1; i >= 0; i--) {
				c[a.size() - 1 - i] = a[i] - '0';
			}

			for (int i = b.size() - 1; i >= 0; i--) {
				d[b.size() - 1 - i] = b[i] - '0';
			}

			for (int j = 0; j < 80; j++) {
				e[j] += c[j] + d[j];
				if (e[j] >= 10) {
					e[j+1] = e[j] / 10;
					e[j] = e[j] % 10;
				} 
			}
		}

		if (e[80] > 0) {
			cout << "overflow" << endl;
		} else {
			for (int k = 79; k >= 0; k--) {
				if (e[k] != 0) {
					counter = k;
					break;
				}
			}
			for (int k = counter; k >= 0; k--) {
				cout << e[k];
			}

			cout << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	while(N--){
		string a,b;
		cin >> a >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while(a.size()>b.size())b += '0';
		while(a.size()<b.size())a += '0';
		string r;
		int c = 0; 
			for(int i = 0 ; i < a.size() ; i++){
			int d = a[i] + b[i] + c - 2 * '0';
			if( d >= 10 ) c = 1;
			r += d%10 + '0';
		}
		if(c)r += '0' + c;
		
		while(r.size()>=2 and r.back() == '0' )
			r = r.substr(0,r.size()-1);
		
		reverse(r.begin(),r.end());
		if( r.size() > 80 ) cout << "overflow" << endl;
		else cout << r << endl;
	}
}

C++: #include "bits/stdc++.h"

#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef long long ll;
ll gcd(ll a, ll b) {
	ll c;
	while (a != 0) {
		c = a; a = b%a;  b = c;
	}
	return b;
}

void solve() {
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif
	int n;
	cin >> n;
	rep(i, n) {
		vector<ll> v1(11), v2(11);
		string s1, s2;
		cin >> s1 >> s2;
		rep(j, 10) {
			if (s1.size() > 10 * j) v1[j] = stoi(s1.substr(10 * j, (s1.size() - 10 * j >= 10 ? 10 : s1.size() - 10 * j)));
			if (s2.size() > 10 * j) v2[j] = stoi(s2.substr(10 * j, (s2.size() - 10 * j >= 10 ? 10 : s2.size() - 10 * j)));
		}
		rep(j, 11) {
			v1[j] += v2[j];
			if (v1[j] >= 1e10) {
				v1[j] -= 1e10;
				v2[j]++;
			}
		}
		if (v1[8] || v1[9] || v1[10]) cout << "overflow" << endl;
		else {
			rep(j, 11) if (v1[10 - j] != 0) cout << v1[10 - j];
			cout << endl;
		}
	}

}




int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	solve();
	//system("PAUSE");
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
int main(){

int n;
cin>>n;
for(int iii=0;iii<n;iii++){
string st1,st2;
int n1[83]={},n2[83]={};
cin>>st1>>st2;
for(int i=0;i<st1.size();i++)
n1[i]=st1[st1.size()-i-1]-'0';
for(int i=0;i<st2.size();i++)
n2[i]=st2[st2.size()-i-1]-'0';
int N[83]={};int y=0;

int r=st1.size();
if(r<st2.size())r=st2.size();
for(int i=0;i<r;i++){
N[i]=(n1[i]+n2[i]+y)%10;
y=(n1[i]+n2[i]+y)/10;
if(i==r-1&&y>0)r++;
}
if(r>80)cout<<"overflow"<<endl;
else{
for(int i=0;i<r;i++)
cout<<N[r-i-1];
cout<<endl;
}}
return 0;
}