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<cstdio>
#include<algorithm>
#include<string>
using namespace std;
string a,b;
long long int s,cop,copp,last,n;
long long int latte[1000],cafe[1000],all[1000],ans[1000];
int main(){
    int cou=0;
    cin>>n;
    for(int l=0;l<n;l++){
        cou=0;
        fill(latte,latte+1000,0);
        fill(cafe,cafe+1000,0);
        fill(all,all+1000,0);
        fill(ans,ans+1000,0);
        cin>>a>>b;
        if(a.size()>b.size()){
            s=a.size();
            cop=a.size(),copp=b.size(),last=s;
        }
        else {
            s=b.size();
            cop=a.size(),copp=b.size(),last=s;
        }
        if(s>80){
            cout<<"overflow"<<endl;
            continue;
        }
        for(int i=0;i<a.size();i++){
            cop--;
            if(a[i]=='0')latte[cop]=0;
            if(a[i]=='1')latte[cop]=1;
            if(a[i]=='2')latte[cop]=2;
            if(a[i]=='3')latte[cop]=3;
            if(a[i]=='4')latte[cop]=4;
            if(a[i]=='5')latte[cop]=5;
            if(a[i]=='6')latte[cop]=6;
            if(a[i]=='7')latte[cop]=7;
            if(a[i]=='8')latte[cop]=8;
            if(a[i]=='9')latte[cop]=9;
            }
        for(int i=0;i<b.size();i++){
            copp--;
            if(b[i]=='0')cafe[copp]=0;
            if(b[i]=='1')cafe[copp]=1;
            if(b[i]=='2')cafe[copp]=2;
            if(b[i]=='3')cafe[copp]=3;
            if(b[i]=='4')cafe[copp]=4;
            if(b[i]=='5')cafe[copp]=5;
            if(b[i]=='6')cafe[copp]=6;
            if(b[i]=='7')cafe[copp]=7;
            if(b[i]=='8')cafe[copp]=8;
            if(b[i]=='9')cafe[copp]=9;
            }
         for(int i=0;i<=s;i++){
            all[i]+=latte[i]+cafe[i];
            if(all[i]>9){
                all[i]-=10;
                all[i+1]+=1;
            }
         }
         /*for(int i=s-1;i>-1;i--){
            if(all[last]!=0)cout<<all[last];
            cout<<all[i];
            all[last]=0;
         }*/
         for(int i=s-1;i>-1;i--){
            if(all[last]!=0){
                ans[last]=all[last];
                cou++;
                all[last]=0;
            }
            ans[i]=all[i];
            cou++;
         }
         if(cou>80)cout<<"overflow";
         else for(int i=s-1;i>-1;i--){
            if(ans[last]!=0)cout<<ans[last];
            cout<<ans[i];
            ans[last]=0;
         }
         cout<<endl;
    }
}
//99999999999999999999999999999999999999999999999999999999999999999999999999999999

C++: import java.util.Scanner;
import java.math.BigInteger;

public class Main{
    public static void main(String args[]) {
	Scanner scanner = new Scanner(System.in);
	int N = scanner.nextInt();
	for (int i = 0; i < N; i++) {
	    String a = scanner.nextString(), b = scanner.nextString();
	    BigInteger sum = BigInteger(a) + BigInteger(b);
	    String n_80 = "1";
	    for (int j = 0; j < 79; j++) {
		n_80 += "0";
	    }
	    if (sum >= BigInteger(n_80)) {
		System.out.println("overflow");
	    }
	    else {
		System.out.println(sum.toString());
	    }
	}
    }
}

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

void add(char *buf1, char *buf2){
	int big1[100] = {}, big2[100] = {};
	
	int len1 = strlen(buf1);
	if(len1 > 80){
		printf("overflow\n");
		return;
	}
	int len2 = strlen(buf2);
	if(len2 > 80){
		printf("overflow\n");
		return;
	}
		
	for(int i = 0; i < len1; i++){
		big1[len1 - i - 1] = buf1[i] - 48;
	}
	for(int i = 0; i < len2; i++){
		big2[len2 - i - 1] = buf2[i] - 48;
	}
	
	int len = (len1 > len2) ? len1 : len2;
	for(int i = 0; i < len; i++){
		big1[i] += big2[i];
		if(big1[i] >= 10){
			big1[i + 1]++;
			big1[i] -= 10;
		}
	}
	
	int j = len + 1;
	for(; j >= 0; j--){
		if(big1[j] > 0){
			break;
		}
	}
	if(j >= 80){
		printf("overflow\n");
		return;
	}
	for(; j >= 0; j--){
		printf("%d", big1[j]);
	}
	printf("\n");
}

int main(){
	int n;
	char buf1[100], buf2[100];
	
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%s", buf1);
		scanf("%s", buf2);
		add(buf1, buf2);
	}
	
	return 0;
}

C++: #include<iostream>
#include<cctype>
#include<cstring>
using namespace std;
int main(){
  int o,a,sl,ss,ansl[82],anss[82];
  cin >> o;
  char n[81],n2[81],nl[82],ns[82],c[80];
  cin.getline(c,80); 
  for(int i=0;i<o;i++){
    cin.getline(n,81);
    cin.getline(n2,81);
    a = 0;
    if( strlen(n)>strlen(n2) ){
      sl = strlen(n);     
      ss = strlen(n2);
      for(int i=sl-1;i>=0;i--){
	nl[a] = n[i];
	a++;
      }
      a = 0;
      for(int i=ss-1;i>=0;i--){
	ns[a] = n2[i];
	a++;
      }
    }
    else{
      sl = strlen(n2);
      ss = strlen(n);
      for(int i=sl-1;i>=0;i--){
	nl[a] = n2[i];
	a++;
      }
      a = 0;
      for(int i=ss-1;i>=0;i--){
	ns[a] = n[i];
	a++;
      }
    }
    for(int i=0;i<sl;i++) ansl[i] = nl[i]-'0';
    for(int i=0;i<ss;i++) anss[i] = ns[i]-'0';
    for(int i=0;i<ss;i++) ansl[i] += anss[i];
    for(int i=0;i<sl;i++){
      if(ansl[i]>=10){
	ansl[i] -= 10;
	if(i+1<sl) ansl[i+1] += 1;
	else{
	  ansl[i+1] = 1;
	  sl += 1;
	}
      }
    }
    if(sl>80) cout << "overflow";
    else  for(int i=sl-1;i>=0;i--) cout << ansl[i];
    cout << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
#include <list>
using namespace std;
 
int main()
{
    int n;
    cin>> n;
    string str1,str2;
    vector<string>s1;
    vector<string>s2;
    for(int i=0;i<n;i++){
       cin>>str1;
       s1.push_back(str1);  
       cin>>str2;    
       s2.push_back(str2);       
    }
    for(int i=0;i<n;i++){
           string str3=s1[i];
           string str4=s2[i];
           int k=str3.size();
           int l=str4.size();           
           int max=k>l?k:l;
           if(max>80) cout<<"overflow"<<endl;
           else{
           int a[80]={0};
           int b[80]={0};
           for(int j=0;j<k;j++){
                a[j]=str3[j]-'0'; } 
           for(int j=0;j<l;j++){
                b[j]=str4[j]-'0'; }
           int temp=0;
           char s[80];
           for(int i=0;i<max;i++){
               int d;
               if(l>i&&k>i) d=a[k-1-i]+ b[l-1-i]+temp;
               if(l<=i&&k>i) d=a[k-1-i]+temp;
               if(l>i&&k<=i) d=b[l-1-i]+temp;
               s[max-1-i]=(d%10)+'0';
               if(d>=10) temp=1;
               else temp=0;
           }
           if(strlen(s)+temp>80) cout<<"overflow"<<endl;
           else{ 
                 if(temp==1) cout<<"1";
                 for(int i=0;i<max;i++){
                    cout<<s[i];}
                }
          cout<<endl;
        }
    }   
    return 0; 
}