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<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], temp[81];
	string ans;

	cin >> n;

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

		cin >> a;
		
		cin >> b;

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

		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{
			int j=0;
			for( int i=1;i<=80;i++ ){
				if( sum[80-i] >= 0 ){
					temp[j] = sum[80-i] + '0';
					j++;
					continue;
				}
				
			}
			temp[j] = '\0';

			ans = temp;

			cout << ans << endl;
		}

	}
	return 0;
}

C++: #include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
    char num1[100],num2[100];
    char sum[100],temp;
    int a,b,q,r,i,big,small,j,testcase;
    cin>>testcase;
    while(testcase--){
        scanf("%s %s",&num1,&num2);
        int len1=strlen(num1);
        int len2=strlen(num2);
        if(len1>80 || len2>80){
            cout<<"overflow\n";
            continue;
        }
        reverse(num1,num1+len1);
        reverse(num2,num2+len2);

        if(len1>len2){
            big=len1;
            small=len2;
        }
        else{
            big=len2;
            small=len1;
        }
        r=0;
        for(i=0;i<small;i++){
            a=num1[i]-48;
            b=num2[i]-48;
            if(a+b+r>9){
                q=(a+b+r)-10;
                r=1;
                sum[i]=q+48;
            }
            else{
                q=a+b+r;
                r=0;
                sum[i]=q+48;
            }
        }
        if(len1>len2){
            for(;i<big;i++){
                a=num1[i]-48;
                a+=r;
                if(a>9){
                    q=a-10;
                    r=1;
                    sum[i]=q+48;
                }
                else{
                    q=a;
                    r=0;
                    sum[i]=q+48;
                }
            }
        }
        else{
            for(;i<big;i++){
                a=num2[i]-48;
                a+=r;
                if(a>9){
                    q=a-10;
                    r=1;
                    sum[i]=q+48;
                }
                else{
                    q=a;
                    r=0;
                    sum[i]=q+48;
                }
            }
        }
        if(r>0){
            q=r;
            sum[i]=q+48;
            sum[++i]='\0';
        }
        else{
            sum[i]='\0';
        }
        j=strlen(sum);
        if(j>80){
            cout<<"overflow\n";
        }
        else{
            reverse(sum,sum+j);
            cout<<sum<<endl;
        }
    }
    return 0;
}

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


int main(){
  int n,i,j;
  
  
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    int sum[110]={};
    string a,b;
    up = 0;
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    int flag=0;
    if(max(sa,sb)>80) flag =1;
    else 
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
    }
    sum[max(sa,sb)]=up;
    int k=max(sa,sb);
    while(sum[k]==0&&k>0) k--;
    if(k>=80||flag==1) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << endl;
  }
}

C++: #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
	long int io[11],it[11],three[11];
	int n,a,b,c,xo,xt,x;
	char one[80],two[80],t[8];
	scanf("%d",&n);
	for(a=0;a<n;a++){
		scanf("%s",&one);
		scanf("%s",&two);
		xo=strlen(one)/8;
		xt=strlen(two)/8;
		if(xo<xt){x=xt;}
		else{x=xo;}
		for(b=0;b<11;b++){
			three[b]=0;
		}
		for(b=0;b<10;b++){
			for(c=0;c<8;c++){
				t[c]=one[c+b*8];
			}
			io[b]=atoi(t);
		}
		for(b=0;b<10;b++){
			for(c=0;c<8;c++){
				t[c]=two[c+b*8];
			}
			it[b]=atoi(t);
		}
		for(b=0;b<=x;b++){
			three[b]+=io[b]+it[b];
			three[b+1]+=three[b]/100000000;
			three[b]=three[b]%100000000;
		}
/*		if(three[10]==0){
			printf("%ld",three[x]);
			for(b=1;b<=x;b++){
				printf("%08ld",three[x-b]);
			}
			printf("\n");
		}
		else{printf("overflow\n");}*/
	}
	return 0;
}