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 <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>
#include <stack>

using namespace std;

int main(){
    
    char d;
    char e;
    using namespace std;
    stack<int> st1;
    stack<int> st2;
    stack<int> st3;
    int n;
    //scanf("%d",&n);
    while((d=getchar())!='\n'){
        n=atof(&d);
    }
    
    for(int i=0; i<n; i++){
        
        while((d=getchar())!='\n'){
            //printf("a%c\n",d);
            st1.push(atof(&d));
        }
        
        //while(getchar()!='\n'){}
        
        while((e=getchar())!='\n'){
            //printf("b%c\n",e);
            st2.push(atof(&e));
        }
        int temp=0;
        int num=0;
        
        while(st1.empty() != true || st2.empty() != true){
            if(st1.empty()==true && st2.empty()!=true){
                temp+=st2.top();
                st2.pop();
            }else if(st1.empty()!=true && st2.empty()==true){
                temp+=st1.top();
                st1.pop();
            }else{
                temp+=st1.top()+st2.top();
                st1.pop();
                st2.pop();
            }
            st3.push(temp%10);
            temp=temp/10;
            num++;
        }
        if(temp!=0){
            st3.push(temp);
        }
        if(st3.size()>80){
            printf("overflow");
        }else{
            while(st3.empty()!=true){
                cout << st3.top();
                st3.pop();
            }
        }
        printf("\n");
        
        
        
    }
    
}

C++: #include <algorithm>
#include <iostream>
using namespace std;
string add(string a,string b){
	string res;
	int sa=a.size(),sb=b.size(),va,vb,t=0;
	for(int i=1;i<=max(sa,sb);i++){
		if(sa-i<0)va=0;else va=a[sa-i]-'0';
		if(sb-i<0)vb=0;else vb=b[sb-i]-'0';
		if(t)va++;
		t=((va+vb)>9);res=(char)(va+vb-t*10+'0')+res;
	}
	if(t)res="1"+res;
	return res;
}
int main() {
	string a,b;
	int n;
	for(cin>>n;n--;){
		cin>>a>>b;
		a=add(a,b);
		if(a.size()>80){
			cout<<"overflow"<<endl;
		}else{
			cout<<a<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
void sum (string &sum, string& a, string& b);

int main(){
  string a1, a2;
  int n, A1, A2;

  cin >> n;
  for(int i = 0; i < n ; i++){
    string sum0 = "";
    cin >> a1 >> a2;
    reverse(a1.begin(), a1.end());
    reverse(a2.begin(), a2.end());
    A1 = a1.length();
    A2 = a2.length();
    if(A1 < A2) {
      swap (A1, A2);
      swap (a1, a2);
    }

    for(int i = 0; i < A1 - A2; i++)   a2 += '0';

    sum(sum0, a1, a2);

    if (sum0.length() > 80) sum0 = "overflow";
    else  reverse(sum0.begin(), sum0.end());
    
    cout << sum0 << endl;
  }
}

void sum(string& buff, string& a, string& b){
  //string buff = "";
  int x = 0, y ;
  for(int i = 0; i < a.length(); i++){
    y = a[i] - '0' + b[i] - '0';
    if (y + x > 9){
      buff += (y + x)% 10 + '0';
      x = 1;
    } else {
      buff += y + x + '0';
      x = 0;
    }
  }
  if (x==1) buff += '1';
  //return &buff;
}

C++: 
#include <cmath>
#include <iostream>
#include <cstdio>
#include <ctype.h>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <iomanip>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <sstream>


using namespace std;


string reverse(string str)
{
	string ret = "";
	
	for (int i=str.length()-1; i>=0; i--)
	{
		ret += str[i];
	}
	
	return ret;
}


/*
指定したインデックスの文字を数値に直して返す関数。
インデックスが不正な場合は数値0を返す。
*/
int new_at(string str, int index)
{
	stringstream ss;
	int ret;
	
	if (index >= str.length())
	{
		return 0;
	} else {
		ss << str[index];
		ss >> ret;
		
		return ret;
	}
}


int main()
{
	int n;
	int ia, ib;
	int flag = 0;	//繰り上がりのフラグ(繰り上がる場合は1)
	int num = 0;	//各桁の和
	
	string sa, sb;	//入力値
	string ra, rb;	//反転した入力値
	
	string sum = "";
	stringstream ss;
	int cnt;	//長いほうの文字数
	
	
	cin >> n;
	for (int i=0; i<n; i++)
	{
		cin >> sa >> sb;
		ra = reverse(sa);
		rb = reverse(sb);
		//cout << "ra = " << ra << " : rb = " << rb << endl;
		
		cnt = (ra.length() > rb.length()) ? ra.length() : sb.length();
		//cout << "cnt = " << cnt << endl;
		
		for (int j=0; j<cnt; j++)
		{
			num += new_at(ra, j) + new_at(rb, j);
			if (flag) num++;
			//cout << "(j=" << j << ") : num = " << num << endl;
			
			if (num >= 10)
			{
				num = num - 10;
				ss << num;
				sum += ss.str();
				num = 0;
				flag = 1;
			} else {
				ss << num;
				sum += ss.str();
				num = 0;
				flag = 0;
			}
			
			ss.str("");
			
			//cout << "(j=" << j << ") : sum = " << sum << endl;
		}
		
		if (flag)
		{
			sum += "1";
			flag = 0;
		}
		
		if (sum.length() > 80)
		{
			cout << "overflow" << endl;
		} else {
			//cout << "sum = " << reverse(sum) << endl;
			cout << reverse(sum) << endl;
		}
		
		sum = "";
		num = 0;
		//cout << "new_at = " << new_at(sa, 3) << endl;
		//cout << "sa = " << reverse(sa) << " : sb = " << reverse(sb) << endl;
		//cout << "sa[0] = " << sa[0] << " : sb[0] = " << sb[0] << endl;
	}
	
	return 0;
}

C++: #include <stddef.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>

using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s1, s2, s3 = "";
    cin >> s1 >> s2;
    size_t m = max(s1.size(), s2.size());
    while (s1.size() < m)
      s1.insert(s1.begin(), '0');
    while (s2.size() < m)
      s2.insert(s2.begin(), '0');
    char c = 0;
    auto it1 = s1.rbegin();
    auto it2 = s2.rbegin();
    for (; it1 != s1.rend(); it1++, it2++) {
      char add = *it1 - '0' + *it2 - '0' + c;
      char ch = add % 10 + '0';
      c = add / 10;
      s3.insert(s3.begin(), ch);
    }
    if (c) s3.insert(s3.begin(), c + '0');
    cout << ((s3.size() > 80) ? "overflow" :s3) << endl;
  }
}