Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include<cstdio>

int main(){
	int a[82] = {};
	int b[82] = {};
	int c[82] = {};
	int n;
	int k,l,m,f;
	char t;
	int of;

	scanf("%d\n", &n);


	for(int i = 0; i < n; i++){
		of = k = l = 0;
		scanf("%c", &t);
		while(t - 10){
			k++;
			a[k] = t - '0';
			scanf("%c", &t);
			if(k == 81){
				of = 1;
				t = 10;
				scanf("%c", &t);
				while(t - 10){
					scanf("%c", &t);
				}
			}
		}
		scanf("%c", &t); 

		while(t - 10){
			l++;
			b[l] = t - '0';
			scanf("%c", &t);
			if(l == 81){
				of = 1;
				t = 10;
				scanf("%c", &t);
				while(t - 10){
					scanf("%c", &t);
				}
			}

		}

		m = 0;
		f = 0;

		while(k - m){
			c[m] = a[k - m];
			m++;
		}
		m = 0;
		while(l - m){
			c[m] += b[l - m ] + f;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		while(f){
			c[m] += 1;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		if(k > m){
			m = k;
		}

		for(int i = 0; i < m; i++){
			if(m == 81 || of){
				printf("overflow");
				i = m;
			}else{
				printf("%d", c[m - i - 1]);
			}
		}
		printf("\n");
	}
	return 0;
}

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;

int main(){
    int n,g;
    int k;
    bool check;

    cin >> n;
    rep(i,n){
        char c1[81], c2[81];
        int i1[81] = {0}, i2[81] = {0};
        int ans[82] = {0};
        check = false;
        k = 0;
        cin >> c1 >> c2;
        for(int j = strlen(c1) - 1; 0 <= j; j--, k++){
            i1[k] = c1[j] - '0';
        }
        k = 0;
        for(int j = strlen(c2) - 1; 0 <= j; j--, k++){
            i2[k] = c2[j] - '0';
        }
        rep(j, 81){
            ans[j]+= i1[j] + i2[j];
            if(ans[j] >= 10){
                ans[j]-=10;
                ans[j+1]++;
            }
        }
        if(ans[81] != 0){
            cout << "overflow";
        }else{
            for(int j = 81; 0 <= j; j--){
                if(ans[j] != 0)
                    check = true;
                if(check == true)
                    cout << ans[j];
            }
        }
        cout << endl;

    }
}

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

void ctod(char *c, int *d){
	int len = strlen(c);
	char ct[10];
	int h = len / 9;
	int a = len % 9;

	for(int i=0;i<9;++i){
		d[i] = 0;
	}
	if(a != 0){
		memcpy(ct, c, a);
		ct[a] = '\0';
		d[h] = atoi(ct);
	}

	for(int i=0; i<h; ++i){
		memcpy(ct, c + len - 9*(i + 1), 9);
		ct[9] = '\0';
		d[i] = atoi(ct);
	}
}

void dtoc(char *c, int *d){
	char ct[10];
	int m = -1;
	int o = 0;
	for(int i=8; i>=0; --i){
		if(d[i] != 0){
			m = i;
			break;
		}
	}
	if(m == -1){
		c[0] = '0';
		c[1] = '\0';
		return;
	}

	sprintf(c, "%d", d[m]);
	o = strlen(c);
	for(int i = m-1; i>=0; --i){
		sprintf(c+o, "%09d", d[i]);
		o += 9;
	}
	c[o] = '\0';
}

void add(int *d1, int *d2, int *d){
	int s = 0;
	for (int i=0; i<9; ++i){
		d[i] = d1[i] + d2[i] + s;
		s = d[i] / 1000000000;
		d[i] -= 1000000000 * s;
	}
}

int main(void){
	int n = 0;
	char i1[255], i2[255], o[255];
	int d1[9], d2[9], d[9];

	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%s", i1);
		scanf("%s", i2);
		if(strlen(i1) > 80 || strlen(i2) > 80){
			puts("overflow");
			continue;
		}

		for(int j=0; j<9;++j){
			d1[j] = d2[j] = d[j] = 0;
		}
		ctod(i1, d1);
		ctod(i2, d2);
		add(d1, d2, d);
		dtoc(o, d);
		if(strlen(o) > 80){
			puts("overflow");
			continue;
		}
		printf("%s\n", o);
	}
	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[200], b[200], x[200], y[200];
		scanf(" %s %s", a, b);
		
		int LA=strlen(a);
		if(LA>80){
			printf("overflow\n");
			continue;
		}
		for(int i=0; i<LA; ++i){
			x[LA-1-i]=a[i];
		}
		
		int LB=strlen(b);
		if(LB>80){
			printf("overflow\n");
			continue;
		}
		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(carry!=0){
			ans[big++]=carry+'0';
			ans[big]='\0';
			//printf("carries\n");
		}	
			
		int LS=strlen(ans);
		char fans[200];
		if(LS>80) printf("overflow\n");
		else{
			for(int i=0; i<LS; ++i){
				fans[i]=ans[LS-1-i];
			}		
			printf("%s\n", fans);
		}
	
	}

	return 0;
}

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

int main(){
	string sx, sy, sans;
	int n;
	getline( cin, sx );
	sscanf( sx.c_str(), "%d", &n );
	for( int i=0; i<n; i++ ){
		getline( cin, sx );
		getline( cin, sy );
		int zx=0, zy=0;
		while( zx+1<sx.length() && sx[zx]=='0' )	zx++;
		for( int j=0; j<sx.length()-zx; j++ ){
			sx[j] = sx[zx+j];
		}
		while( zy+1<sy.length() && sy[zy]=='0' )	zy++;
		for( int j=0; j<sy.length()-zy; j++ ){
			sy[j] = sy[zy+j];
		}
		if( (sx.length()-zx)>80 || (sy.length()-zy)>80 ){
			cout << "overflow" << endl;
		}else{
			int lenx = sx.length()-zx;
			int leny = sy.length()-zy;
			string &s = (lenx>leny)?sx:sy;
			string &sa = (lenx>leny)?sy:sx;
			int &len = (lenx>leny)?lenx:leny;
			int &lena = (lenx>leny)?leny:lenx;
			sans.resize( len+1 );
			for( int j=0; j<sans.length(); j++ )
				sans[j] = 0;
			for( int j=0; j<lena; j++ ){
				sans[j] += (sa[lena-1-j]-'0') + (s[len-1-j]-'0');
				if( sans[j] > 9 ){
					sans[j] -= 10;
					sans[j+1]++;
				}
			}
			for( int j=lena; j<len; j++ ){
				sans[j] += s[len-1-j]-'0';
				if( sans[j] > 9 ){
					sans[j] -= 10;
					sans[j+1]++;
				}
			}
		}
		if( sans.length()>80 && sans[sans.length()-1]>0 ){
			cout << "overflow" << endl;
		}else{
			for( int j=(sans[sans.length()-1]==0?sans.length()-2:sans.length()-1); j>=0; j-- ){
				cout << (int)sans[j];
			}
			cout << endl;
		}
	}
	return 0;
}