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<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

const int MAX = 81;

int main(){
    int n;
    cin >> n;
    while(n--){
        vector<int> ans;
        string input1, input2;
        int len1, len2, up = 0;
        
        cin >> input1 >> input2;
        len1 = input1.length() - 1;
        len2 = input2.length() - 1;
        reverse(input1.begin(), input1.end());
        reverse(input2.begin(), input2.end());

        rep(i,MAX){
            int add = up;
            if(i <= len1){
                add+= input1[i] - '0';
            }
            if(i <= len2){
                add+= input2[i] - '0';
            }
            if(!(add == 0 && i > len1 && i > len2))
            ans.push_back(add % 10);
            up = add / 10;
            if(i > len1 && i > len2) break;
        }

        if(ans.size() > 80){
            cout << "overflow" << endl;
        }else{
            vector<int>::iterator it;
            it = ans.end();
            while(ans.size() != 0){
                --it;
                cout << *it;
                ans.pop_back();
            }cout << endl;
        }
    }
}

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

using namespace std;

int main() {
	int N, c = 0, tmp;
	cin >> N;
	string ans;
	for (int i = 0; i < N; i++) {
		ans = "";
		string a, b;
		cin >> a >> b;
		for (int j = 0; j < max(a.length(), b.length()); j++) {
			int A, B;
			A = a.length() - j - 1;
			B = b.length() - j - 1;
			tmp = (A >= 0 ? a[A] - '0' : 0) + (B >= 0 ? b[B] - '0' : 0) + c;
			ans = (char)(tmp % 10 + '0') + ans;
			c = tmp / 10;
		}
		if (c) {
			ans = '1' + ans;
		}
		cout << (ans.length() >= 80 ? "overflow" : ans) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
using namespace std;

int main() {
	string a;
	string b;
	int n;
	cin >> n;
	for (int i = 0; i < n;i++) {
		cin >> a >> b;
		string ans;
		if (a.size() < b.size()) {
			swap(a, b);
		}
		int back = 0;
		for (int j = 1; j <=a.size(); j++) {
			int d = a[a.size() - j] - '0' + b[b.size() - j] - '0' + back;
			ans = (char)(d % 10 + '0') + ans;
			back = d / 10;
		}
		if (back == 1) {
			ans = "1" + ans;
		}
		if (ans.size() > 80) {
			cout << "overflow" << endl;
		}
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#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;
	if(a.size()<b.size())swap(a,b);
	int as=a.size(),bs=b.size();
	for(int i=0;i<as-bs;i++)b="0"+b;
	c=a;
	bool kuri=false;
	int sum=0;
	for(int i=a.size()-1;i>=0;i--){
		 sum=a[i]-'0';
		char now;
		sum=sum+b[i]-'0';
		if(kuri)sum++;
		if(sum>=10){
			kuri=true;
				sum-=10;
				//cout<<"a";
		}
		else{
			kuri=false;
		}
		now=sum+'0';
		//cout<<sum;
		c[i]=now;
	}
	if(kuri)c="1"+c;
	
	if(c.size()>80)cout<<"overflow"<<endl;
	else cout<<c<<endl;
	c.clear();
	}
	return 0;
}

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

int main() {
    int num; cin >> num;
    for(int k = 0; k < num; k++) {
        string s1, s2, ret;
        vector<int> v1, v2;
        cin >> s1 >> s2;
        if(s2.length() > s1.length()) swap(s1,s2);
        for(int i=0; i<s1.length(); i++) v1.push_back((int)s1[i] - 48);
        for(int i=0; i<s2.length(); i++) v2.push_back((int)s2[i] - 48);

        reverse(v1.begin(), v1.end());
        reverse(v2.begin(), v2.end());

        int n = 0;
        for(int i=0; i<v2.size(); i++) {
            ret += to_string((v1[i] + v2[i] + n) % 10);
            if(v1[i] + v2[i] + n >= 10) n = 1;
            else n = 0;
        }
        for(int i=v2.size(); i<v1.size(); i++) {
            ret += to_string((v1[i] + n) % 10);
            if(v1[i] + n >= 10) n = 1;
            else n = 0;
        }
        if(v1[v1.size() - 1] + n == 10) ret += "1";

        reverse(ret.begin(), ret.end());
        cout << ret << endl;
    }
    return 0;
}