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 <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int number(char c){
	if(c>='0'&&c<='9')
	return (c-'0');
	else
		return 0;
}
int main(){
	int n;
	cin>>n;
	
	while(n>0){
		string a;
		string b;
	int k=0;
	int c=0;
	string s="";
	
		cin>>a;
		cin>>b;
		
	
	for(int i=a.length()-1,j=b.length()-1;i>=0||j>=0;i--,j--){
		int d;
		int n1=0,n2=0;
		if(i>=0)
			n1=number(a[i]);
		if(j>=0)
			n2=number(b[j]);
		d=n1+n2+k;
		k=d/10;
		d=d%10;
		s=to_string(d)+s;
	}
		if(k>0)
		s=to_string(k)+s;
	
	if(s.length()>80)
		cout<<"overflow"<<endl;
	else
		cout<<s<<endl;
		n--;
	}
}

C++: #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;


int getValue(string str, int i){
	int endp,startp;

	endp = str.length() - 8 * i;
	startp = str.length() - 8 - 8 * i;
	if( endp <= 0 )
		return 0;
	else if( startp <= 0 ) {
		return atoi( str.substr(0,endp).c_str() );					
	}
	else {
		return atoi( str.substr(startp,8).c_str() );					
	}
	return -1;
}


int main()
{
	int num,i,j,startp,endp;
	string str1, str2;
	long v1,v2;
	int v[10];
	cin >> num;
	for(i = 0; i < num; i++ ) {
		cin >> str1;
		cin >> str2;
		if( str1.length() > 80 || str2.length() > 80 ){
			
		}
		//8桁ずつ分けて計算
		int flg = 0;
		for( j = 0; j < 10; j++ ) {
			v1 = getValue( str1, j );
			v2 = getValue( str2, j );
			
			v[j] = v1 + v2 + flg;
			if( v[j] >= 100000000 ) {
				flg = 1;
				v[j] -= 100000000;
			}
			else {
				flg = 0;
			}
		}
		if( flg == 1 )
			printf("overflow\n");
		else {
			flg = 0;
			for( j = 9 ; j >= 0; j-- ) {
				if( v[j] > 0 ){
					printf("%d",v[j] );
					flg = 1;
				}
				else if( flg == 1 ) {
					printf("%08d",v[j] );
				}
				
			}
			printf("\n");	
		}
	}




	return 0;
}

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

int main(){
	int n;
	scanf(" %d", &n);
	
	for(int i=0; i<n; ++i){
		char a[81], b[81], x[81], y[81];
		scanf(" %s %s", a, b);
		
		int LA=strlen(a);
		for(int i=0; i<LA; ++i){
			x[LA-1-i]=a[i];
		}
		int LB=strlen(b);
		for(int i=0; i<LB; ++i){
			y[LB-1-i]=b[i];
		}
		
		int big, small;
		bool isA;
		if(LA>LB) {big=LA; small=LB; isA=true;}
		else {big=LB; small=LA; isA=false;}
		
		char ans[81];
		int carry=0;
		for(int i=0; i<small; ++i){
			int ta=x[i]-'0', tb=y[i]-'0';
			ta+=tb+carry;
			
			if(ta>=10) carry=1;
			else carry=0;
			ans[i]=(ta%10)+'0';
		}
		if(isA){
			for(int i=small; i<big; ++i){
				int ta=x[i]-'0';
				ta+=carry;
			
				if(ta>=10) carry=1;
				else carry=0;
				ans[i]=(ta%10)+'0';
			}
		}
		else{
			for(int i=small; i<big; ++i){
				int tb=y[i]-'0';
				tb+=carry;
			
				if(tb>=10) carry=1;
				else carry=0;
				ans[i]=(tb%10)+'0';
			}
		}
		
		if(big>=81 && carry!=0) printf("overflow\n");
		else{
			if(carry!=0){
				ans[big++]=carry+'0';
				ans[big]='\0';
				//printf("carries\n");
			}	
			
			int LS=strlen(ans);
			char fans[82];
			for(int i=0; i<LS; ++i){
				fans[i]=ans[LS-1-i];
			}	
		
			printf("%s\n", fans);
		}
	
	}

	return 0;
}

C++: #include <bits/stdc++.h>

//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;

inline std::string Add_MultiplePrecision(const std::string A, const std::string B) {

	int a[200] = {};
	int b[200] = {};
	int c[300] = {};

	for (unsigned int i = 0; i < A.length(); i++) {
		a[i] = A[A.length() - 1 - i] - '0';
	}
	for (unsigned int i = 0; i < B.length(); i++) {
		b[i] = B[B.length() - 1 - i] - '0';
	}

	int carry = 0;
	for (unsigned int i = 0; i < std::max(A.length(), B.length()); i++) {
		c[i] = (a[i] + b[i] + carry) % 10;
		c[i + 1] = carry = (a[i] + b[i] + carry) / 10;
	}

	int st = 299;
	while (c[st] == 0) {
		st--;
	}

	std::string ans;
	for (int i = st; i >= 0; i--) {
		ans += std::to_string(c[i]);
	}

	if (ans == "") {
		ans = "0";
	}

	return ans;
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	int n = 0;
	std::cin >> n;
	std::vector<std::string> ans(n);

	for (int i = 0; i < n; i++) {
		std::string temp1, temp2, temp3;
		std::cin >> temp1 >> temp2;
		temp3 = Add_MultiplePrecision(temp1, temp2);
		if (temp3.length() >= 80) {
			ans[i] = "overflow";
		}
		else {
			ans[i] = temp3;
		}
	}

	for (int i = 0; i < n; i++) {
		std::cout << ans[i] << std::endl;
	}
}