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.h>

int main(int argc, const char * argv[]) {
    int a[80];
    int b[80];
    char temp[80];
    int x, y;
    int s[80];
    int a_num, b_num, n, i;

    scanf("%d", &y);
    for (i=0; i<y; i++) {
        for (n = 0; n < 80; n++) {
            a[n] = 0;
            b[n] = 0;
            s[n] = 0;
        }
        
        a_num = 0;
        scanf("%s", temp);
        a_num = (int)strlen(temp) - 1;
        for (n = 0; n <= a_num; n++){
            a[a_num - n] = temp[n] - 48;
        }

        b_num = 0;
        scanf("%s", temp);
        b_num = (int)strlen(temp) - 1;
        for (n = 0; n <= b_num; n++) {
            b[b_num - n] = temp[n] - 48;
        }
        
        if (a_num > 80 || b_num > 80) {
            printf("overflow\n");
        } else {
            if (a_num >= b_num) {
                for (n=0; n <= a_num; n++) {
                    x = a[n] + b[n] + s[n];
                    if (x > 9) {
                        s[n+1]++;
                        x = x - 10;
                    }
                    s[n] = x;
                }
                if (s[a_num+1] > 0) printf("%d", s[a_num+1]);
                for (n=a_num; n >= 0; n--) {
                    printf("%d", s[n]);
                }
                printf("\n");
            } else {
                for (n=0; n <= b_num; n++) {
                    if ((x = a[n] + b[n] + s[n]) > 9) {
                        s[n+1]++;
                        x = x - 10;
                    }
                    s[n] = x;
                }
                if (s[b_num+1] > 0) printf("%d", s[b_num+1]);
                for (n=b_num; n >= 0; n--) {
                    printf("%d", s[n]);
                }
                printf("\n");
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
const int DIGIT=9;

int main() {
  int n;
  char buf[81];
  int l, x[2], y, z;
  char buf_part[DIGIT+1];
  int a[2][9];
  int b[9];

  cin >> n;
  while (n--) {
    for (int i=0; i<2; i++) {
      cin >> buf;
      l = strlen(buf);
      x[i] = (l+DIGIT-1)/DIGIT;
      y = (l-1)%DIGIT+1;
      for (int j=0; j<9; j++) {
        a[i][j] = 0;
      }
      for (int j=0; j<x[i]; j++) {
        if (!j) {
          memcpy(buf_part, buf, y);
          buf_part[y] = '\0';
        } else {
          memcpy(buf_part, &buf[y+DIGIT*(j-1)], DIGIT);
          buf_part[DIGIT] = '\0';
        }
        a[i][x[i]-j-1] = atoi(buf_part);
      }
    }

    /*for (int i=0; i<9; i++) b[i] = 0;
    z = (x[0] > x[1]) ? x[0] : x[1];
    for (int i=0; i<z; i++) {
      b[i] = a[0][i] + a[1][i];
      if (b[i] >= 1000000000) {
        a[0][i+1]++;
        b[i] -= 1000000000;
      }
    }
    if (z<9 && a[0][z]) {
      b[z] = a[0][z]+a[1][z];
      ++z;
    }
    if (b[8] >= 100000000) {
      cout << "overflow" << endl;
    } else {
      cout << b[z-1];
      for (int i=z-2; i>=0; i--) {
        cout.fill('0');
        cout.width(DIGIT);
        cout << b[i];
      }
      cout << endl;
    }*/
  }
  return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
int chrtoint(char a){
int i;
i=a-48;
 return i;
return 0;
}

int main(){
char n1[1000];
char n2[1000];
int rs[1000];
int c1, c2;

int i,j,m, cmax, sum,testcase;
scanf("%d",&testcase);
while(testcase--){
scanf("%s", &n1);
scanf("%s", &n2);
c1 = strlen(n1);
c2 = strlen(n2);

reverse(n1,n1+c1);
reverse(n2,n2+c2);

cmax = c1;
if(c1<c2){
cmax = c2;
}

m=0;
for(i=0; i< cmax; i++){
if(c1==c2 || (i < c1 && i < c2)){
sum = m+chrtoint(n1[i])+chrtoint(n2[i]);
}else if(i >=c1){
sum = m+chrtoint(n2[i]);
}else if(i >=c2){
sum = m+chrtoint(n1[i]);
}
if(sum>9){
m = 1;
rs[i] = sum-10;
}
else{
m=0;
rs[i] = sum;
}
}

if(m){
rs[i]=m;
i++;
}
if(i>80){
    printf("overflow\n");
    continue;
}
for(j=0; j < i; j++){
printf("%d", rs[i-j-1]);
}
}
return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
int main(){
    long long n;
    scanf("%lld\n",&n);
    for(long long ix=0;ix<n;ix++){
        char t1[85],t2[85];
        scanf("%s\n%s\n",t1,t2);
        string s1(t1),s2(t2);
        reverse(s1.begin(),s1.end());
        reverse(s2.begin(),s2.end());
        string res;
        int kuri=0;
        for(int i=0;i<80;i++){
            int now;
            if(i<s1.size()&&i<s2.size())now=(s1[i]-'0')+(s2[i]-'0')+kuri;
            else if(i<s1.size())now=(s1[i]-'0')+kuri;
            else if(i<s2.size())now=(s2[i]-'0')+kuri;
            else if(kuri==1)now=kuri;
            else break;
            res.append(1,(char)(now%10+'0'));
            kuri=now/10;
        }
        if(kuri==1)printf("overflow\n");
        else{
            reverse(res.begin(),res.end());
            printf("%s\n",res.c_str());
        }
    }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int number(char c){
	if(c>='0'&&c<='9')
	return (c-'0');
	else
		return 0;
}
int main(){
	int n;
	cin>>n;
	
	while(n>0){
		string a;
		string b;
	int k=0;
	int c=0;
	string s="";
	
		cin>>a;
		cin>>b;
		
	
	for(int i=a.length()-1,j=b.length()-1;i>=0||j>=0;i--,j--){
		int d;
		int n1=0,n2=0;
		if(i>=0)
			n1=number(a[i]);
		if(j>=0)
			n2=number(b[j]);
		d=n1+n2+k;
		k=d/10;
		d=d%10;
		c++;
		s=to_string(d)+s;
	}
	if(c>=80&&k>0)
		cout<<"overflow"<<endl;
		else{
			if(k>0){
		s=to_string(k)+s;
			}
		cout<<s<<endl;
		}
		n--;
	}
}