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 N;
    cin >> N;
    for (int i=0; i<N; i++) {
        string a, b, c;
        cin >> a >> b;
        int sum, ret=0;
        if (a.length() < b.length()) swap(a,b);
        int l = b.length()-1;
        for (int i=a.length()-1; i>=0; i--) {
            if (l >= 0) {
                sum = (a[i]-'0')+(b[l]-'0')+ret;
                l--;
            } else {
                sum = (a[i]-'0')+ret;
            }
            if (sum>=10) {
                ret = 1;
                sum -= 10;
            } else {
                ret = 0;
            }
            c[i] = sum+'0';
        }
        if (ret != 0) {
            c.insert(a.begin(), ret+'0');
        }
        if (c.length() > 80) cout << "overflow" << endl;
        else cout << c << endl;
    }
    return 0;
}

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

using namespace std;

int main() {
	int n;
	cin >> n;

	unsigned long long a, b;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		a += b;

		if (a / pow(10, 80) >= 1) {
			cout << "overflow";
		}
		else {
			cout << a;
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int f1(char c) {
	if (c == '1')return 1;
	else if (c == '2')return 2;
	else if (c == '3')return 3;
	else if (c == '4')return 4;
	else if (c == '5')return 5;
	else if (c == '6')return 6;
	else if (c == '7')return 7;
	else if (c == '8')return 8;
	else if (c == '9')return 9;
	else if (c == '0')return 0;
}
char f2(int f) {
	if (f == 1)return '1';
	else if (f == 2)return '2';
	else if (f == 3)return '3';
	else if (f == 4)return '4';
	else if (f == 5)return '5';
	else if (f == 6)return '6';
	else if (f == 7)return '7';
	else if (f == 8)return '8';
	else if (f == 9)return '9';
	else if (f == 0)return '0';
	else return 'a';
}
void solve() {
	string s, t, ans; cin >> s >> t;
	if (s.size() > t.size()) {
		string tmp = s;
		s = t;
		t = tmp;
	}
	int k = 0;
	for (int i = 1; i <= s.size(); i++){
		int p;
		p = f1(s[s.size() - i]) + f1(t[t.size() - i]) + k;
		if (p > 9) { k = 1; p -= 10; }
		else k = 0;
		ans = f2(p) + ans;
	}
	for (int i = s.size() + 1; i <= t.size(); i++){
		int p = f1(t[t.size() - i]) + k;
		if (p > 9) { k = 1; p -= 10; }
		else k = 0;
		ans = f2(p) + ans;
	}
	if (k == 1)ans = '1' + ans;
	if (ans.size() > 80)cout << "overflow";
	else cout << ans; cout << endl;
	return;
}
int main() {
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		solve();
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	int a,b;
	long long sum;
	int i;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a>>b;
		sum=(long long)a+b;
		if(sum>INT_MAX)	cout<<"overflow"<<endl;
		else	cout<<sum<<endl;
	}
	return 0;
}

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

int main() {
  int tcase;
  
  cin >> tcase;
  while(tcase--) {
    string A, B, C = "";
    cin >> A >> B;
    
    unsigned sz = max(A.size(), B.size());
    while(A.size()<sz) A = '0' + A;
    while(B.size()<sz) B = '0' + B;

    int c = 0;
    for(int i=sz-1; i>=0; i--) {
      // 確定情報
      C += (( (A[i]-'0') + (B[i]-'0') + c ) % 10 + '0');
      // 前座
      c = ( (A[i]-'0') + (B[i]-'0') + c ) / 10;
    }
    if(c>0) C += (c + '0');
    
    reverse(C.begin(), C.end());
    cout << C << endl;
  }
  return 0;
}

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

string error = "overflow";

int main(){
	ios::sync_with_stdio(false);
	cout.sync_with_stdio(false);
	int n;
	cin >> n;
	bool over[n];
	int keta[n];
	string a[n], b[n];
	char c[n][81]; 
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 81; j++){
			c[i][j] = '0';
		}
	}
	for(int i = 0; i < n; i++){
		over[i] = false;
		keta[i] = 0;
		int extra = 0;
		cin >> a[i] >> b[i];
		if(a[i].size() < b[i].size()){
			swap(a[i],b[i]);
		}
		
		for(int j = 0; j < a[i].size(); j++){
			int p, q, num;
			stringstream sa, sb, sc;
			sa << a[i][a[i].size()-j-1];
			sa >> p;
			if(j < b[i].size()){
				sb << b[i][b[i].size()-j-1];
				sb >> q;
			}
			else{
				q = 0;
			}
			if(p+q+extra < 10){
				sc << p+q+extra;
				sc >> c[i][j];
				extra = 0;
			}
			else{
				int kurai;
				kurai = (p+q+extra)%10;
				sc << kurai;
				sc >> c[i][j];
				extra = 1;
				if(j == a[i].size()-1){
					c[i][a[i].size()] = '1';
					keta[i] = 1;
				}
			}
		}
		if(c[i][80] != '0'){
			over[i] = true;
		}
	}
	for(int i = 0; i < n; i++){
		if(over[i] == true){
			cout << error;
		}
		else{
			for(int j = 0; j < a[i].size()+keta[i]; j++){
			cout << c[i][a[i].size()+keta[i]-j-1];
			}
		}
		cout << endl;
	}
}