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<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			//if(mlen>79){
				cout<<"overflow"<<endl;
				//continue;
			//}
			//cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			//cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

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

#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;

using Cint = cpp_int;

int main() {
	Cint temp_1, temp_2; int n; cin >> n;
	Cint max = pow((Cint)10, 80);
	for (int i = 0; i < n; i++) {
		cin >> temp_1 >> temp_2;
		if (temp_1 + temp_2 >= max) cout << "overflow" << endl;
		else cout << temp_1 + temp_2 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
int func()
{
	char i1[81]="",i2[81]="",res[81]="";
	bool cflag=false;
	std::string tmp;
	std::cin >> tmp;
	if(tmp.size()>80)
		return -1;
	strcpy(i1,tmp.c_str());
	std::cin >> tmp;
	if(tmp.size()>80)
		return -1;
	strcpy(i2,tmp.c_str());
	for(int j=0;j<80;j++){
		char c='0';
		if(cflag)
			c+=1;
		cflag=false;
		if(strlen(i1)>j){
			c+=i1[strlen(i1)-j-1]-'0';
		}
		if(strlen(i2)>j){
			c+=i2[strlen(i2)-j-1]-'0';
		}
		if(c > '9'){
			cflag=true;
			c-=10;
		}
		res[79-j]=c;
	}

	if(cflag)
		return -1;
	char *p = res;
	while(*p++ == '0');
	std::cout << (p-1) << std::endl;

	return 0;
}
int main(void){
	int n;
	std::cin >> n;
	for(int i=0; i<n; i++)
		if(func()==-1)
			std::cout << "overflow" << std::endl;

}

C++: #include <iostream>
#define MAX_BITS	(80)

class LargeNumber
{
public:
	LargeNumber() : bits({0}) {}
	~LargeNumber() {}
	void fromString(const std::string& str) {
		int size = str.length();
		int max = size < MAX_BITS ? size : MAX_BITS;
		for (int i=0; i<max; i++) {
			bits[i] = str[size-1-i] - '0';
		}
		for (int i=max; i<size; i++) {
			if (str[size-1-i] - '0' > 0) {
				bits[MAX_BITS] = 1;
				break;
			}
		}
	}
	std::string toString() {
		std::string str = "";
		bool b = false;
		for (int i=MAX_BITS-1; i>0; i--) {
			if (!b) {
				if (!bits[i]) {
					continue;
				}
				b = true;
			}
			str.push_back(bits[i] + '0');
		}
		str.push_back(bits[0] + '0');
		return str;
	}
	bool isOverflow() {
		if (bits[MAX_BITS]) return true;
		return false;
	}
	const LargeNumber operator+(const LargeNumber& rhs) const {
		LargeNumber ret;
		for (int i=0; i<MAX_BITS; i++) {
			ret.bits[i]  += bits[i] + rhs.bits[i];
			ret.bits[i+1] = ret.bits[i] / 10;
			ret.bits[i]   = ret.bits[i] % 10;
		}
		ret.bits[MAX_BITS] += bits[MAX_BITS] + rhs.bits[MAX_BITS];
		return ret;
	}
private:
	unsigned char bits[MAX_BITS+1];
};

int main() {
	int n; std::cin >> n;
	std::string line;
	for (int i=0; i<n; i++) {
		LargeNumber in1; std::cin >> line; in1.fromString(line);
		LargeNumber in2; std::cin >> line; in2.fromString(line);
		LargeNumber out = in1 + in2;
		if (out.isOverflow()) {
			std::cout << "overflow" << std::endl;
		} else {
			std::cout << out.toString() << std::endl;
		}
	}
	return 0;
}

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

using namespace std;
int main(){
	int n,l,m,c;
	char a[90],b[90];
	cin >> n;
	for(int i=0;i<n;i++){
		char s[90] = {0};
		scanf("%s%s",a,b);
		l = strlen(a);
		m = strlen(b);
		reverse(a,a+l);
		reverse(b,b+m);
		c=0;
		for(int j=0;j<max(l,m);j++){
			int o=c;
			if(j<l)o += a[j]-'0';
			if(j<m)o += b[j]-'0';
			c = o>9;
			s[j] = o%10 + '0';
		}
		l=max(l,m);
		if(c>0)s[l++]='1';
		reverse(s,s+l);
		if(l>80)cout << "overflow" << endl;
		else printf("%s\n",s);//cout << s << endl;
	}
	return 0;
}

C++: //0015
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;
int main(){
	string n1,n2,rn1,rn2,ans="";
	char a='0',te,tem;
	int b,bb,ro;
	int s1,s2,rs1,rs2,s=0;
	bool up=false;
	int N;
	cin>>N;
	for(int i=0;i<N;i++){
		ans="";
		cin>>n1>>n2;
		n1.length()>=n2.length() ? ro=n1.length() : ro=n2.length();
		reverse(n1.begin(),n1.end());
		rn1=n1;
		reverse(n2.begin(),n2.end());
		rn2=n2;
		//cout<<"_______"<<endl;
		for(int j=0;j<ro+1;j++){
			te=rn1[j];tem=rn2[j];
			b=(te-'0')+(tem-'0')+(up?1:0);
			if(b>=10){
				b=b%10;
				 a= b+'0';
				up=true;
			}else{
				a = b+'0';
			}
			ans[s]=a;
			s++;
		}

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

	}
	return 0;
}