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<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;

    while(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]++;
                }
            }
            for(int j = 81; 0 <= j; j--){
                if(ans[81] != 0){
                    cout << "overflow";
                    break;
                }
                if(ans[j] != 0)
                    check = true;
                if(check == true)
                    cout << ans[j];
            }cout << endl;
        }
    }
}

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

int main(){

	int n;

	string a, b;
	char N1[80], N2[80];
	char sum[80];
	string ans;

	cin >> n;

	for( int i=0;i<n;i++ ){

		cin >> a;
		
		if( a.length() >= 80 ){
			cout << "overflow" << endl;
			continue;
		}

		cin >> b;

		if( b.length() >= 80 ){
			cout << "overflow" << endl;
			continue;
		}

		for( int i=0;i<80;i++ ){
			N1[i] = -1; N2[i] = -1; sum[i] = 0;
		}

		for( int i=1;i<=a.length();i++ )
			N1[i] = a[a.length()-i] - '0';
		for( int i=1;i<=b.length();i++)
			N2[i] = b[b.length()-i] - '0';

		int over = 0;
		
		for( int i=0;i<80;i++ ){


			if( N1[i] == -1 && N2[i] == -1 ){
				if( over >= 10 ){
					sum[i] = over / 10;
					over = 0;
				}else
					sum[i] = -1;
				continue;
			}

			if( N1[i] != -1 )
				sum[i] += N1[i];
			if( N2[i] != -1 )
				sum[i] += N2[i];

			sum[i] += over / 10;

			over = floor((double)sum[i]/10)*10;

			sum[i] -= over;
			
		}

		if(over > 0)cout << "overflow" << endl;
		else{
			for( int i=1;i<=80;i++ ){
				if( sum[80-i] >= 0 )
					cout << (char)(sum[80-i] + '0');
			}
			cout << endl;
		}

	}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#define MAX(x,y) (x>y?x:y)
using namespace std;

int N;
int sum[1000][100];
	char stra[1000][85],strb[1000][85];

int main(){
	int i,j;
	int a[100],b[100];
	cin >> N;
	for(i = 0;i < N;i++){
		for(j = 0;j < 100;j++){
			a[j] = 0;
			b[j] = 0;
		}
		cin >> stra[i];
		for(j = strlen(stra[i])-1;j >= 0;j--){
			a[j] = stra[i][strlen(stra[i])-1-j]-48;
		}
		cin >> strb[i];
		for(j = strlen(strb[i])-1;j >= 0;j--){
			b[j] = strb[i][strlen(strb[i])-1-j]-48;
		}
		for(j = 0;j < MAX(strlen(stra[i]),strlen(strb[i]));j++){
			sum[i][j] += (a[j]+b[j]);
			sum[i][j+1] += (sum[i][j])/10;
			sum[i][j] %= 10;
		}
	}
	for(i = 0;i < N;i++){
		for(j = 99;sum[i][j] == 0 && j > 0;j--);
		if(j >= 80)
			cout << "overflow" << endl;
		else{
			for(j;j >= 0;j--)
				cout << sum[i][j];
			cout << endl;
		}
	}
	return 0;
}

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

#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
int main() {
	int n;
	cin >> n;
	while(n--) {
		string a, b;
		int x[84], y[84], s[84], max;
		cin >> a >> b;
		if(a.length() > 80 || b.length() > 80) {
			cout << "overflow" << endl;
			break;
		}
		int i = 0, j = 0;
		for(; a[i] != '\0'; ++i) {
			x[i] = a[i] - '0';
		}
		for(; b[j] != '\0'; ++j) {
			y[j] = b[j] - '0';
		}
		
		if(i > j) {
			for(int k = j - 1; k >= 0; k--) {
				y[i-j+k] = y[k];
			}
			rep(k,i-j) {
				y[k] = 0;
			}
			max = i;
		} else if(i < j) {
			for(int k = i - 1; k >= 0; k--) {
				x[j-i+k] = x[k];
			}
			rep(k,j-i) {
				x[k] = 0;
			}
			max = j;
		} else max = i;
		bool f = 0;
		for(int k = max - 1; k >= 0; k--) {
			int c = x[k] + y[k];
			if(f) c++;
			if(c >= 10) {
				f = 1, c -= 10;
			} else f = 0;
			s[k] = c;
		}
		if(f) {
			max++;
		}
		if(max > 80) cout << "overflow" << endl;
		else {
			string ans;
			if(f) {
				ans += "1";
				max--;
			}
			rep(k,max) {
				ans += s[k] + '0';
			}
			cout << ans << endl;
		}
	}
	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[200];
		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;
}