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 <vector>

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

constexpr int MAX_DIGIT = 80;
constexpr int OVERFLOW = 20;

int main()
{
    int data_num;
    cin >> data_num;

    while (data_num--) {
        string in01_str, in02_str;
        cin >> in01_str >> in02_str;

        vector<int> in01(MAX_DIGIT + OVERFLOW, 0), in02(MAX_DIGIT + OVERFLOW, 0);
        for (unsigned i = 0; i < in01_str.size(); i++) {
            in01.at(i) = in01_str.at(in01_str.size() - 1 - i) - '0';
        }
        for (unsigned i = 0; i < in02_str.size(); i++) {
            in02.at(i) = in02_str.at(in02_str.size() - 1 - i) - '0';
        }

        if (in01.at(MAX_DIGIT) != 0 || in02.at(MAX_DIGIT) != 0) {
            cout << "overflow" << endl;
            continue;
        }

        vector<int> out(MAX_DIGIT + OVERFLOW, 0);
        for (unsigned i = 0; i < MAX_DIGIT; i++) {
            out.at(i) += in01.at(i) + in02.at(i);
            if (out.at(i) / 10 != 0) {
                out.at(i) -= 10;
                out.at(i + 1)++;
            }
        }

        if (out.at(MAX_DIGIT) != 0) {
            cout << "overflow" << endl;
            continue;
        }

        while (out.at(out.size() - 1) == 0 && out.size() != 1) {
            out.erase(out.end() - 1);
        }

        for (unsigned i = 0; i < out.size(); i++) {
            cout << out.at(out.size() - 1 - i);
        }
        cout << endl;
    }

    return 0;
}

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

using namespace std;

int main(void){
	int n;

	cin >> n;
	for(int i=0;i<n;i++){
		int len,mlen=0;
		char val[2][128]={0},tmp[128],crr=0;

		for(int j=0;j<2;j++){
			cin >> tmp;
			len = strlen(tmp);
			mlen = mlen>len?mlen:len;
			for(int k=0;k<len;k++)
				val[j][len-1-k]=tmp[k]-0x30;
		}

		if(mlen<=80)
			for(int j=0;j<mlen;j++){
				val[0][j]+=val[1][j]+crr;
				crr=val[0][j]/10;
				val[0][j]%=10;

				if(j==mlen-1&&crr)
					mlen++;
			}

		if(mlen<=80){
			for(int j=0;j<mlen;j++)
				tmp[j]=val[0][mlen-1-j]+0x30;
			tmp[mlen]='\0';
		}
		else
			strcpy(tmp,"overflow");

		cout << tmp << 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((max+temp)>80) cout<<"overflow";
           else{ 
                 if(temp==1) cout<<"1";
                 for(int i=0;i<max;i++){
                    cout<<s[i];}
                }
           cout<<endl;
        }
    }   
    return 0; 
}

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

using namespace std;

void arrangeDigits(string &str1, string &str2){

  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  
  while(str1.size() < str2.size()){
    str1 += '0';
  }
  while(str2.size() < str1.size()){
    str2 += '0';
  }
}

int main(){
  int numDatasets;
  cin >> numDatasets;
  
  for(int i=0;i<numDatasets;i++){
    bool flag = false;
    string str1, str2;

    cin >> str1;
    cin >> str2;

    // ??????????????????
    // arrangeDigits(str1, str2);

    reverse(str1.begin(), str1.end());
    reverse(str2.begin(), str2.end());

    while(str1.size() < str2.size()){
      str1 += '0';
    }
    while(str2.size() < str1.size()){
      str2 += '0';
    }
    
      
    //?¨????

    int c = 0;
    string res;

    // cout << str1.length() << endl;
    
    for(int i=0;i<str1.size();i++){

      int now = c + str1[i] - '0' + str2[i] -'0';
      res += now%10 + '0';
      c = now/10;
    }

    if(c){
      res += c+'0';
    }

    if(res.size()>80){
      flag == true;
    }

    reverse(res.begin(), res.end());
    
    if(flag == false){
      cout << res << endl;
    }else{
      cout << "overflow" << endl;
    }
    
  }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> pint;
#define rep(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

int N;

int f(string s1,string s2,int x){
	if(N>80){cout<<"overflow"<<endl;return 0;}
	if(s1.size()<=N&&s2.size()<=N&&x==0)return 0;
	if(s1.size()>N)x+=s1[s1.size()-N-1]-'0';
	if(s2.size()>N)x+=s2[s2.size()-N-1]-'0';
	++N;
	f(s1,s2,x/10);
	if(N<=80)cout<<x%10;
	return 0;
}

int main(){
	int n,a=0;
	cin>>n;
	rep(i,n){
		if(a)cout<<endl;
		a++;
		N=0;
		string s1,s2;
		cin>>s1>>s2;
		f(s1,s2,0);
	}
	cout<<endl;
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	int n,m;
	string aindex, bindex, ans;
	cin >> m;
	n = 0;
	string a,b;
	for(int j = 0; j < m; j++){
		cin >> a >> b;
		if(a.size()>=81||b.size()>=81){
			cout << "overflow" << endl;
		}else{
			for(int i = 0; i< max(a.size(),b.size()); i++){
				if(a.size()>= i+1){
					aindex = a[a.size()-i-1];
				}else{
					aindex = "0";
				}
				if(b.size() >= i+1){
					bindex = b[b.size()-i-1];
				}else{
					bindex = "0";
				}
				n = stoi(aindex) + stoi(bindex) + (n-n%10==10);
				aindex = to_string(n%10);
				ans = aindex + ans;
			}
			if(ans.size()>=81){
				cout << "overflow" << endl;
			}else{
				if(n-n%10 == 10){
					ans = '1' + ans;
				}
				cout << ans << endl;
			}
		}
		ans ="";
		n = 0;
	}
	return 0;
}