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(){
  int N; cin >> N;

  for(int i=0; i<N; i++){
    string S1, S2;
    cin >> S1 >> S2;
    int l1 = S1.length(), l2 = S2.length();

    string S; int carry = 0;
    for(int i=0; i<max(l1, l2)+1; i++){
      if(i < l1 && i < l2){
        int s1 = S1[l1-1-i] - '0', s2 = S2[l2-1-i] - '0';
        char a = (s1+s2+carry) % 10 + '0';
        S.push_back(a);
        if(s1+s2+carry >= 10) carry = 1;
        else carry = 0;
      } else if (i == max(l1, l2)){
        if(carry == 1) S.push_back('1');
      } else if (i >= l1){
        int s2 = S2[l2-1-i] - '0';
        char a = (s2+carry) % 10 + '0';
        S.push_back(a);
        if(s2+carry >= 10) carry = 1;
        else carry = 0;
      } else if(i >= l2){
        int s1 = S1[l1-1-i] - '0';
        char a = (s1+carry) % 10 + '0';
        S.push_back(a);
        if(s1+carry >= 10) carry = 1;
        else carry = 0;
      }
    }
    reverse(S.begin(), S.end());

    if(S.length()>80){
      cout << "overflow" << endl;
    } else {
      cout << S << endl;
    }
  }
}

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

int main(){
    
    int ap,bp,cp,t;
    char a[999],b[999],c[82];
    
    scanf("%d",&t);
    while (scanf("%s %s",a,b)) {
        ap = strlen(a);
        bp = strlen(b);
        c[cp=(ap>80 || bp>80)? 0:81]='\0';
        t=0;
        while ((t||ap||bp) && cp>0) {
            t +=(ap? a[--ap]-'0':0) + (bp? b[--bp]-'0':0);
            c[--cp] = t%10 + '0';
            t /=10;
        }
        if(cp>0) printf(&c[cp]);
        else printf("overflow");
        printf("\n");
    }
    
    return 0;
    
}

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

string sum( string sa, string sb ){
    string ret = "0";
    int len = max( sa.size(), sb.size() );
    reverse( sa.begin(), sa.end() );
    reverse( sb.begin(), sb.end() );
    while( sa.size()<len )  sa += '0';
    while( sb.size()<len )  sb += '0';
    for( int i=0; i<len; i++ ){
        ret[i] += sa[i]-'0' + sb[i]-'0';
        if( ret[i] > '9' ){
            ret += '1';
            ret[i] -= 10;
        }else if( i!=len-1 ){
            ret += '0';
        }
    }
    reverse( ret.begin(), ret.end() );
    if( ret.size() > 80 ){
        ret = "overflow";
    }
    return ret;
}

int main(){
    int n;
    cin >> n;
    while(n--){
        string a, b;
        cin >> a >> b;
        cout << sum(a, b) << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string a,b,c;
	int n;
	cin>>n;
	for(int fjal=0;fjal<n;fjal++){
	cin>>a>>b;
	c.clear();
	if(a.size()<b.size())swap(a,b);
	int as=a.size();
	while(as!=b.size())b="0"+b;
	//cout<<a<<" "<<b;
	bool kuri=false;
	for(int i=as-1;i>=0;i--){
		int _a=a[i]-'0',_b=b[i]-'0',ans=_a+_b;
		if(kuri)ans++;
		if(ans>=10){
			kuri=true;
			ans-=10;
		}
		else {kuri=false;}
		c.push_back(ans+'0');
	}
		if(kuri)c.push_back('1');
	
		if(c.size()<80){for(int i=c.size()-1;i>=0;i--)cout<<c[i]-'0';
		cout<<endl;
		}
		else cout<<"overfllow"<<endl;
	}
	return 0;
}

C++: //#define _USE_MATH_DEFINES
#include <iostream>
//#include <stdio.h>
//#include <iomanip>
#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <cmath>
//#include <time.h>

using namespace std;


int main(){

	int n, k1, k2, left, right, buf, flag;
	string s1, s2 , out;
	int aa1[10], aa2[10], ans[10];



	cin >> n;

	for (int i = 0; i < n; i++){
		for (int i = 0; i < 10; i++){
			aa1[i] = 0;
			aa2[i] = 0;
			ans[i] = 0;
		}
		flag = 0;

		cin >> s1 >> s2;
		k1 = s1.size();
		k2 = s2.size();

		if (k1 > 80 || k2 > 80){
			cout << "overflow" << endl;
		}
		else{
			buf = 8 - k1 % 8;
			for(int i = 0; i < buf; i++){
				s1.insert(0,"0");
			}
			buf = 8 - k2 % 8;
			for (int i = 0; i < buf; i++){
				s2.insert(0, "0");
			}
			left = s1.size()-8;
			for (int i = 0; i < 10; i++){
				aa1[i] = atoi(s1.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}
			left = s2.size() - 8;
			for (int i = 0; i < 10; i++){
				aa2[i] = atoi(s2.substr(left, 8).c_str());
				left -= 8;
				if (left < 0)break;
			}

			for (int i = 0; i < 10; i++){
				ans[i] += aa1[i] + aa2[i];
				if (ans[i] >= 100000000){
					ans[i + 1] += 1;
					ans[i] -= 100000000;
				}
			}
			if (ans[10] >= 100000000){
				cout << "overflow" << endl;
			}
			else{
				for (int i = 9; i >= 0; i--){
					if (flag == 0){
						if (ans[i] != 0){
							printf("%d",ans[i]);
							flag = 1;
						}
					}
					else{
						printf("%08d", ans[i]);
					}
				}
				cout << endl;
			}
		}

	}
	
	return 0;
}