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 <cstring>
using namespace std;

int main(){
  int j;
  int n;
  char s1[111];
  char tmp[111];
  char s2[111];
  char ans[111];
  int  kuri = 0;
  cin >> n;
  while(n--){
  memset(ans,0,sizeof(ans));
  memset(s1,0,sizeof(s1));
  memset(s2,0,sizeof(s2));
  memset(tmp,0,sizeof(tmp));
  cin >> s1 >> s2;
  if(strlen(s1) > 80 || strlen(s2)> 80){
    cout << "overflow" << endl;
  }
  else if(strlen(s1) < strlen(s2)){
    for(int i=0,j=strlen(s1)-1;i<=j;i++,j--) swap(s1[i],s1[j]);
    for(int i=0,j=strlen(s2)-1;i<=j;i++,j--) swap(s2[i],s2[j]);
    for(int i=0;i<strlen(s2);i++){
      if((s2[i] + (s1[i]%'0') + kuri) > '9'){
	ans[i] = (s2[i] + (s1[i]%'0') + kuri)-10;
	kuri = 1;
      }
      else {
	ans[i] = (s2[i] + (s1[i]%'0') + kuri);
	kuri = 0;
      }
      if(i == strlen(s2)-1 && kuri == 1) ans[i+1] = '1';
    }
    if(strlen(ans) > 80) cout << "overflow" << endl;
    else{
      for(int i=strlen(ans)-1;i>=0;i--) cout << ans[i];
    }
  }
  else{
    for(int i=0,j=strlen(s1)-1;i<=j;i++,j--) swap(s1[i],s1[j]);
    for(int i=0,j=strlen(s2)-1;i<=j;i++,j--) swap(s2[i],s2[j]);
    for(int i=0;i<strlen(s1);i++){
      if((s1[i] + (s2[i]%'0') + kuri) > '9'){
	ans[i] = (s1[i] + (s2[i]%'0') + kuri)-10;
	kuri = 1;
      }
      else {
	ans[i] = (s1[i] + (s2[i]%'0') + kuri);
	kuri = 0;
      }
      if(i == strlen(s1)-1 && kuri == 1) ans[i+1] = '1';
    }
    if(strlen(ans) > 80) cout << "overflow" << endl;
    else{
      for(int i=strlen(ans)-1;i>=0;i--) cout << ans[i];
    }
  }
  cout << endl;
  }
}

C++: #include<stdio.h>
#include<string.h>
int c[1000];
int a[1000];
int b[1000];
char s1[1000];
char s2[1000];
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        memset(a,0,sizeof(a));
        memset(b,0,sizeof(b));
        memset(c,0,sizeof(c));
        memset(s1,'\0',sizeof(s1));
        memset(s2,'\0',sizeof(s2));
        scanf("%s %s",s1,s2);
        int x=strlen(s1);
        int y=strlen(s2);
        int m;
        int j=0;
        if(x>80||y>80)
            printf("overflow\n");
        else
        {
            for(int i=x-1; i>=0; i--)
            {
                a[j++]=s1[i]-'0';
            }
            int k=0;
            for(int i=y-1; i>=0; i--)
            {
                b[k++]=s2[i]-'0';
            }
            if(x<y)
            {
                m=x;
                x=y;
                y=m;
            }
            int l=0;
            for(int i=0; i<x+1; i++)
            {
                c[i]=a[i]+b[i]+l;
                if(c[i]>=10)
                {
                    l=c[i]/10;
                    c[i]=c[i]%10;
                }
                else
                    l=0;
            }
            int n=0;
            for(int i=x; i>=0; i--)
            {
                if(c[i]!=0)
                {
                    n=i;
                    break;
                }
            }
            if(n==0&&a[0]==0&&b[0]==0)
                printf("0\n");
            else if(n>80)
                printf("overflow\n");
            else
            {
                for(int i=n; i>=0; i--)
                    printf("%d",c[i]);
                printf("\n");
            }
        }
    }
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  cin>>n;
  while(n--){
    string a,b;
    cin>>a>>b;
    if(a.size()<b.size())swap(a,b);
    while(a.size()!=b.size())b='0'+b;
    //cout<<a<<endl<<b<<endl;
    rep(i,a.size()){
      int tmp=a.size()-i-1;
      a[tmp]+=b[tmp]-'0';
      if(!tmp)break;
      if(a[tmp]>'9'){a[tmp]-=10;a[tmp-1]++;}
    }
    if(a[0]>'9'){a[0]-=10;a='1'+a;}
    if(a.size()>80)cout<<"overflow"<<endl;
    else cout<<a<<endl;
  }
}

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

using namespace std;

int main(){
    
    string d;
    string e;
    
    
    int n=0;
    scanf("%d",&n);
    
    for(int i=0; i<n; i++){
        int f[81]={0};
        int g[81]={0};
        int h[81]={0};
        
        cin>>d;
        cin>>e;
        
        int j=81;
        for(int i=(int)d.length()-1; i>=0; i--){
            f[j] = (d[i]-'0');
            j--;
        }
        j=81;
        for(int i=(int)e.length()-1; i>=0; i--){
            g[j] = (e[i]-'0');
            j--;
        }
        

        
//        for(int i=0; i<=81; i++){
//            printf("%d",f[i]);
//        }
//        printf("\n");
//        
//        for(int i=0; i<=81; i++){
//            printf("%d",g[i]);
//        }
//        printf("\n");
        
        int temp=0;
        for(int i=81; i>=0; i--){
            temp = temp + f[i]+g[i];
            h[i] = temp % 10;
            temp = temp /10;
        }
        j=0;
        while(h[j]==0){
            j++;
        }
        
        for(int i=j; i<=81; i++){
            printf("%d",h[i]);
        }
        printf("\n");
    }
    
    
}

C++: #include <iostream>
#include <string.h>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
  int n, maxlen;
  char a[100], b[100];

  cin >> n;
  for(int ii = 0 ; ii < n ; ii++){
    string ans = "";
    scanf("%s%s", a, b);
    
    maxlen = max(strlen(a), strlen(b));

    reverse(a, a+strlen(a));
    reverse(b, b+strlen(b));
    
    for(int i = strlen(a) ; i < 100 ; i++){
      a[i] = '0';
    }
    for(int i = strlen(b) ; i < 100 ; i++){
      b[i] = '0';
    }

    int tmp, tmp2 = 0;
    bool flag = 0;

    for(int i = 0 ; i < maxlen ; i++){
      tmp = (a[i] - '0') + (b[i] - '0') + tmp2;
      
      if(i == maxlen - 1){
	//cout << "OK" << endl;
	//tmp = (a[i] - '0') + (b[i] - '0') + tmp2;
	if(tmp >= 10){
	  tmp2 = 1;
	  tmp -= 10;
	  ans += tmp + '0';
	  ans += '1';
	}
	else ans += tmp + '0';
      }

      else if(tmp >= 10){
	tmp2 = 1;
	tmp -= 10;
	ans += tmp + '0';
      }
      else if(tmp <= 9){
	ans += tmp + '0';
	tmp2 = 0;
      }
    }

    reverse(ans.begin(), ans.end());
    int size = ans.size();

    if(size >= 80 || maxlen >= 80) cout << "overflow" << endl;
    else cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <boost/multiprecision/cpp_int.hpp>

using namespace boost::multiprecision;

int main()
{
  unsigned int a;
  cpp_int b, c;
  std::cin >> a;
  for (unsigned int i = 0; i < a * 2; ++i) {
    if (i % 2 == 0) {
      std::cin >> b;
    } else {
      std::cin >> c;
      std::cout << b + c << std::endl;
    }
  }
}