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<algorithm>
#include<iostream>
#include<cstdio>
#include<stdio.h>
#include<string>
#include<string.h>
//#include"stdafx.h"
using namespace std;

int main()
{
	char a1,a2  ;
	long long a, b,c;
	int kaisu = 0;
	cin >> kaisu;
	for (int i = 0; i < kaisu; i++)
	{
		cin >> a;
		cin >> b;
		a1 =  GetDigit(a);
		a2 = GetDigit(a);
		if (a1 + a2 >= 80) { printf("overflow"); }
		else { c = a + b; printf(c + "\n"); }
	}
	return 0;
}
unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}

C++: #include <iostream>
#include <vector>
#include<string>
#include<sstream>

#define CAPACITY 9

 
namespace stoi{
 
    int stoi(std::string str){
        int ret;
        std:: stringstream ss;
        ss << str;
        ss >> ret;
        return ret;
    }
 
}
class OverDigit{
 
public:
 
    int num_a[CAPACITY];
    int num_b[CAPACITY];
    OverDigit(std::string str_a, std::string str_b);
    void ChangeDigit(std::string str,int num[]);
    void Add();
};
 
OverDigit::OverDigit(std::string str_a,std::string str_b){
 
    ChangeDigit(str_a, num_a); 
    ChangeDigit(str_b, num_b);
 
}
 
void OverDigit::ChangeDigit(std::string str, int num[]){
 
    std::vector <int> num_str(CAPACITY, 0);
    int loc = CAPACITY, k = 8;
    int str_Max, str_rest;
 
    str_Max = str.length() / CAPACITY;//
    str_rest = str.length() % CAPACITY;
 
        for (int j = str.length() - CAPACITY; str_Max > 0; j = j-CAPACITY){
        num_str[k] = stoi::stoi(str.substr(j, CAPACITY));
        loc = k;
        k--;
        str_Max--;
    }
     
        if(str_rest!=0)num_str[loc - 1] = stoi::stoi(str.substr(0, str_rest));
 
    for (int j = 0; j < CAPACITY; j++){
    num[j]=num_str[j];
    }
}
//80?????????§?????¶???????
void OverDigit::Add(){
 
    int num_ans[CAPACITY] = {};
    int fat,overflow=0,count=0;
 
    for (int j = CAPACITY-1; j >0; j--){
        if (num_a[j] + num_b[j]<=999999999){
            num_ans[j] = num_a[j] + num_b[j];
        }
        else if (num_a[j] + num_b[j] > 999999999){
            fat = (num_a[j] + num_b[j]) - 1000000000;
            num_ans[j] = fat;
            num_a[j - 1]++;     
        }
 
    }
 
     if (num_a[0] + num_b[0] > 99999999){
        overflow = 1;
     }
     else{
         num_ans[0]= num_a[0] + num_b[0];
          
 
     }
 
    if (overflow == 1){
        std::cout << "overflow" << std::endl;
    }
    else {
        for (int j = 0; j < CAPACITY; j++){
            if (num_ans[j] != 0){
                count++;
                std::cout << num_ans[j];
 
            }
            else if (num_ans[j] == 0 && count >= 1){
                std::cout << "000000000";
            }
 
        }std::cout << std::endl;
    }
 
};
 
 
int main(){
    int N;
    std::string str_a, str_b;
 
    std::cin >> N;
    std::cin.ignore();
 
    for (int i = 0; i < N; i++){
        getline(std::cin, str_a);
        getline(std::cin, str_b);
        OverDigit OverDigit_a(str_a,str_b);
  //      OverDigit_a.Add();
    }
 
    return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>

using namespace std;

void Swap(string&, string&);
vector<int> Atoi(string);

int main(){
  int i, j, n, a, b;
  vector<int> x, y, z;
  string s, t;

  cin >> n;

  for(i=0; i<n; ++i){
    cin >> s >> t;
    if(s.size() < t.size()) Swap(s, t);

    if(s.size() < 80){
      x = Atoi(s);
      y = Atoi(t);

      b = 0;
      for(j=0; j<y.size(); ++j){
	a = x[j] + y[j] + b;
	if(a >= 10){
	  a -= 10;
	  b = 1;
	}else{
	  b = 0;
	}
	z.push_back(a);
      }

      for(j=y.size(); j<x.size(); ++j){
	a = x[j] + b;
	if(a >= 10){
	  a -= 10;
	  b = 1;
	}else{
	  b = 0;
	}
	z.push_back(a);
      }
      if(b == 1) z.push_back(1);

      if(z.size() < 80){
	for(j=z.size()-1; j>=0; --j)
	  cout << z[j];
	cout << endl;
      }else{
	cout << "overflow" << endl;
      }

      x.clear();
      y.clear();
      z.clear();

    }else{
      cout << "overflow" << endl;
    }
  }
  return 0;
}

void Swap(string& s, string& t){
  string u;
  u = s;
  s = t;
  t = u;
}

vector<int> Atoi(string s){
  int i, n;
  vector<int> x;

  for(i=s.size()-1; i>=0; --i){
    n = s[i]-48;
    x.push_back(n);
  }

  return x;
}

C++: #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <math.h>

using namespace std;
double a,b,c;
int input; 

int main()
{
	scanf("%d",&input);
	for(int loop=1;loop<=input;loop++)
	{
	scanf("%lf %lf",&a,&b);
	c=a+b;
	if(c<10^80&&a<10^80&&b<10^80)
	printf("%.0lf\n",c);
	else
	printf("overflow\n");
	}
	return 0;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;


int main(){
    int n;
    cin>>n;
    
    rep(i,n){
        int x[100]={},y[100]={};
        string a,b;
        cin>>a>>b;
        for(int i=a.size()-1;i>=0;i--){
            x[a.size()-1-i]=a[i]-'0';
        }
        for(int i=b.size()-1;i>=0;i--){
            y[b.size()-1-i]=b[i]-'0';
        }
        int ans[100]={};
        for(int i=0;i<80;i++){
            ans[i]+=x[i]+y[i];
            ans[i+1]+=ans[i]/10;
            ans[i]-=ans[i]/10*10;
        }
        if(ans[80]!=0)cout<<"overflow"<<endl;
        else{
            bool flag=false;
            for(int i=79;i>=0;i--){
                if(ans[i]!=0)flag=true;
                if(flag)cout<<ans[i];
            }
        }
        cout<<endl;
        
    }
    return 0;
}

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

int strToInt(string str) {
  int ans = 0;
  for(int i = 0; i < str.length(); i++) {
    ans += ((int)str[i] - (int)'0') * (str.length() - i);
  }
  return ans;
}

int charToInt(char c) {
  return (int)c - (int)'0';
}

string sumStr(string a, string b) {
  int pa = a.length()-1, pb = b.length()-1;
  string str(81, '0');
  int pstr = str.length()-1;
  int next = 0;
  while(pa >= 0 && pb >= 0) {
    int temp = charToInt(a[pa]) + charToInt(b[pb]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pa--;
    pb--;
    pstr--;
  }
  while(pa >= 0) {
    int temp = charToInt(a[pa]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pa--;
    pstr--;
  }
  while(pb >= 0) {
    int temp = charToInt(b[pb]) + next;
    next = temp / 10;
    str[pstr] = (char)(temp%10+(int)'0');

    pb--;
    pstr--;
  }
  str[pstr] = (char)(next + (int)'0');

  for(int i = 0; i < str.length(); i++) {
    if(str[i] != '0') {
      return str.substr(i, str.length()-i);
    }
  }
  return "0";
}

int main(void) {
  int N;
  cin >> N;
  for(int i = 0; i < N; i++) {
    bool overflow = false;
    int data[N][8];
    string sum;
    for(int j = 0; j < 2; j++) {
      string str;
      cin >> str;

      if(!overflow) {
	if(j == 0) sum = str;
	else       sum = sumStr(sum, str);
        if(sum.length() > 80) overflow = true;
      }
    }

    if(overflow) cout << "overflow" << endl;
    else         cout << sum << endl;
  }
  return 0;
}