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++: #define scanf_s scanf
#define sscanf_s sscanf
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
//#define CONSTNUM 10000000
int main(void)
{
	int n, s = 0, x, y, r = 0, a, b;
	int sum_n[50][3] = { 0 };
	char sum[50][_MAX], astr[_MAX], bstr[_MAX], num[11] = { "0123456789" };
	char ca, cb;
	scanf_s("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf_s("%s %s", &astr, &bstr);
		for (x = 0; astr[x] != '\0'; ++x);
		for (y = 0; bstr[y] != '\0'; ++y);
		if (x >= 80 || y >= 80) {
			printf("overflow\n");
			continue;
		}
		for (int j = 0; j < x || j < y; ++j) {
			if (j < x && j < y) {
				ca = astr[x - j - 1]; cb = bstr[y - j - 1];
				sscanf_s(&ca, "%d", &a);
				sscanf_s(&cb, "%d", &b);
				if (x > y) sum[i][x - j] = num[(a + b + r) % 10];
				else sum[i][y - j] = num[(a + b + r) % 10];
				if (a + b + r >= 10) r = (a + b + r) / 10;
				else r = 0;
			}
			else {
				if (x > y) {
					if (r != 0) {
						ca = astr[x - j - 1];
						sscanf_s(&ca, "%d", &a);
						sum[i][x - j] = num[(a + r) % 10];
						if (a + r >= 10) r = (a + r) / 10;
						else r = 0;
					}
					else {
						sum[i][x - j] = astr[x - j - 1];
					}
				}
				else {
					if (r != 0) {
						cb = bstr[y - j - 1];
						sscanf_s(&cb, "%d", &b);
						sum[i][y - j] = num[(b + r) % 10];
						if (b + r >= 10) r = (b + r) / 10;
						else r = 0;
					}
					else {
						sum[i][y - j] = bstr[y - j - 1];
					}
				}
			}
		}
		if (y < 80 - r && x < 80 - r) {
			if (r == 1) 	printf("%d", r);
			for (int j = 1; j <= x || j <= y; ++j) {
				printf("%c", sum[i][j]);
			}
		}
		else {
			printf("overflow");
		}
		printf("\n");
		r = 0;
	}
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){

  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string a,b,s;
    int how=0;
    cin>>a>>b;
    reverse(a.begin(),a.end());
    reverse(b.begin(),b.end());
    for(int j=0;j<a.size()||j<b.size();j++){
      if(j<a.size()) how+=a[j]-'0';
      if(j<b.size()) how+=b[j]-'0';
      s.push_back(how%10+'0');
      how/=10;
    }
    if(how!=0) s.push_back(how+'0');
    reverse(s.begin(),s.end());
    if(s.size()>80) cout<<"overflow"<<endl;
    else cout<<s<<endl;
  }
  return 0;

}

C++: #include<iostream>
#include<vector>
#include<string>
using namespace std;
vector<int> V,W,A;
int main(){
	int n,a,b;
	cin>>n;
	string str;
	char num[10]={'0','1','2','3','4','5','6','7','8','9'};
	for(int i=0;i<n;i++){
		cin>>str;
		for(int j=0;j<str.size();j++){
			for(int k=0;k<10;k++){
				if(str[j]==num[k]){
					V.push_back(k);
					break;
				}
			}
		}
		cin>>str;
		for(int j=0;j<str.size();j++){
			for(int k=0;k<10;k++){
				if(str[j]==num[k]){
					W.push_back(k);
					break;
				}
			}
		}
		int v=V.size(),w=W.size();
		int flag=0;
		while(v || w){
			int x=0;
			if(v==0){
				if(W[w-1]+flag>=10){
					A.push_back(W[w-1]+flag-10);
					W.pop_back();
					flag=1;
				}else{
					A.push_back(W[w-1]+flag);
					W.pop_back();
					flag=0;
				}
			}else if(w==0){
				if(V[v-1]+flag>=10){
					A.push_back(V[v-1]+flag-10);
					V.pop_back();
					flag=1;
				}else{
					A.push_back(V[v-1]+flag);
					V.pop_back();
					flag=0;
				}
			}else{
				if(V[v-1]+W[w-1]+flag>=10){
					A.push_back(V[v-1]+W[w-1]-10+flag);
					V.pop_back();
					W.pop_back();
					flag=1;
				}else{
					A.push_back(V[v-1]+W[w-1]+flag);
					V.pop_back();
					W.pop_back();
					flag=0;
				}
			}
			v=V.size();
			w=W.size();
		}
		if(flag)
		A.push_back(flag);
		for(int j=A.size()-1;j>=0;j--){
			cout<<A[j];
		}
		cout<<endl;
		V.clear();
		W.clear();
		A.clear();
	}
	return 0;
}

C++: #include <cstdio>
#include <cstring>
using namespace std;
#define def 1000

int main(void){
  int i,j,n,len,tmp,max,digits,A[def],B[def],C[def];
  char str[def];

  fgets(str,sizeof(str),stdin);
  sscanf(str,"%d",&n);
  for(i=0;i<n;i++){
    memset(A,0,sizeof(A));
    memset(B,0,sizeof(B));
    memset(C,0,sizeof(C));
    tmp = 0;
    digits = 0;
    /*for(j=0;j<5;j++){
      printf("%d",A[j]);
    }
    printf("\n");*/
    fgets(str,sizeof(str),stdin);
    len = strlen(str)-2;
    max = len;
    digits = max+1;
    //printf("%d\n",len);
    for(j=len;j>=0;j--){
      A[len-j] = str[j]%48;
      //printf("%d",A[len-j]);
    }
    //printf("\n");
    fgets(str,sizeof(str),stdin);
    len = strlen(str)-2;
    if(len>max){
      max = len;
      digits = max+1;
    }
    for(j=len;j>=0;j--){
      B[len-j] = str[j]%48;
      //printf("%d",A[len-j]);
    }
    for(j=0;j<=max;j++){
      //printf("%d ",(A[j] + B[j] + tmp)%10);
      C[max+1-j] = (A[j] + B[j] + tmp)%10;
      tmp = (A[j] + B[j] + tmp)/10;
      //printf("%d\n",tmp);
      if(j==max && tmp!=0){
        C[0] = tmp;
        digits += 1;
      }
      if(digits>80){
        printf("overflow");
        goto end;
      }
      //printf("%d",B[len-j]);
    }
    for(j=0;j<=max+1;j++){
      if(j==0 && C[j]==0) continue;
      printf("%d",C[j]);
    }
    end:;
    printf("\n");
    //Calculation(A,B);
  }
  return 0;
}

C++: #include<cstdio>
#include<iostream>
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        char moneywrite[2][150];
        int money[2][150];
        int stl[2]={0,0};
        int stlstl;
        int sum[81];
        scanf("%s",moneywrite[0]);
        scanf("%s",moneywrite[1]);
        for(int j=0;moneywrite[0][j]!='\0';j++){
            money[0][j]=moneywrite[0][j]-'0';
            stl[0]++;
        }
        for(int j=0;moneywrite[1][j]!='\0';j++){
            money[1][j]=moneywrite[1][j]-'0';
            stl[1]++;
        }
        if(stl[0]>stl[1]){
            stlstl=stl[0];
            int p;
            p=stl[0]-stl[1];
            for(int j=0;j<stl[0];j++){
                money[1][stl[0]-j]=money[1][stl[0]-j-p];
            }
            for(int k=0;k<p;k++)
                money[1][k]=0;
        }
        else if(stl[1]>stl[0]){
            stlstl=stl[1];
            int p;
            p=stl[1]-stl[0];
            for(int j=0;j<stl[1];j++){
                money[0][stl[1]-j]=money[0][stl[1]-j-p];
            }
            for(int k=0;k<p;k++)
                money[0][k]=0;
        }
        else{
            stlstl=stl[1];
        }
/*
        for(int j=0;j<stlstl;j++)
            printf("[%d][%d]\n",money[0][j],money[1][j]);
*/
        if(80<=stlstl){
            printf("overflow");
            goto exit;
        }
        for(int j=stlstl-1;0<=j;j--){
            sum[j]=money[0][j]+money[1][j];
            if(10<=sum[j]){
                if(stlstl==79){
                    printf("overflow");
                    goto exit;
                }
                else if(j==0){
                    printf("1");
                    sum[j]%=10;
                }
                else{
                    money[0][j-1]++;
                    sum[j]%=10;
                }
            }
        }
        for(int j=0;j<stlstl;j++)
            printf("%d",sum[j]);
exit:
        puts("");
    }
    return 0;
}