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<iostream>
#include<algorithm>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
using namespace std;
int a[110],b[110],c[110];
char x[110],y[110];
void ff(char z[110])
{
    int d=strlen(z);
    for(int i=0;i<d/2;i++)
    {
        swap(z[i],z[d-1-i]);
    }

}
int main()
{
   int n;
   scanf("%d",&n);
   while(n--)
   {
       memset(a,0,sizeof(a));
       memset(b,0,sizeof(b));
       memset(c,0,sizeof(c));
       scanf("%s%s",x,y);
      ff(x),ff(y);
     for(int i=0;i<strlen(x);i++)
     {
         a[i]=x[i]-'0';
     }
     for(int i=0;i<strlen(y);i++)
     {
         b[i]=y[i]-'0';
     }
     int d=0,s;
      for(int i=0;i<110;i++)
      {
          s=a[i]+b[i]+d;
         c[i]=s%10;
         d=s/10;
      }
      int p=0;
      for(int i=109;i>=0;i--)
      {
          if(c[i])
          {
              p=i;
              break;
          }
      }
      if(p>=80)
      {
          printf("overflow\n");
         
      }
      else
        {
          for(int i=p;i>=0;i--)
          {
              printf("%d",c[i]);
          }
          printf("\n");
      }
   }
}

C++: #include <stdio.h>
#include <string.h>
#include <stdlib.h>

int makeBigInt80(char*, const char*);
int sumBigInt80(char*, const char*, const char*);

int main(void){
	int i, n;
	char buf[81], a[81], b[81];
	
	scanf("%d", &n);
	
	while(n--){
		scanf(" %s", buf);
		makeBigInt80(a, buf);
		
		scanf(" %s", buf);
		makeBigInt80(b, buf);
		
		if(sumBigInt80(buf, a, b))
			printf("overflow\n");
		else{
			for(i = 0; i < 81; i++)
				if(buf[i] != '0') break;
			
			printf("%s\n", buf + i);
		}
	}
}

int makeBigInt80(char *s, const char *t){
	int l, i;
	
	l = 80 - strlen(t);
		
	for(i = 0; i < l; i++)
		s[i] = '0';
	
	strcpy(s + l, t);
	
	return 0;
}

int sumBigInt80(char *sum, const char *a, const char *b){
	int i, n;
	int m = 0;
	
	for(i = 79; i >= 0; i--){
		n = (a[i] - '0') + (b[i] - '0') + m;
		m = n / 10;
		sum[i] = (n % 10) + '0';
	}
	
	sum[80] = '\0';
	
	return (m ? -1 : 0);
}

C++: #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char* add(const char* a, const char* b)
{
    int sizeA, sizeB, sizeX;
    int A, B, C;
    char* x;
    char* t;
    int la, lb, lx;
    C = 0;
    sizeA = strlen(a);
    sizeB = strlen(b);
    sizeX = (sizeA > sizeB ? sizeA : sizeB)+1;
    x = (char*)calloc(sizeX, 1);
    la = sizeA - 1;
    lb = sizeB - 1;
    lx = sizeX - 1;
    
    while(lx >= 0){
        A = la >= 0 ? a[la] - '0' : 0;
        B = lb >= 0 ? b[lb] - '0' : 0;
        x[lx] = '0' + (A + B + C) % 10;
        C = (A + B + C) / 10;
        la--;
        lb--; 
        lx--;
    }
    if (*x == '0'){
        t = (char*)calloc(sizeX - 1, 1);
        strcpy(t, x + 1);
        free(x);
        return t;
    }
    return x;
}
int main()
{
    int i;
    int N;
    char first[201];
    char second[201];
    char* result;
    scanf("%d", &N);
    for(i = 0; i < N; ++i){
        scanf("%s", first);
        scanf("%s", second);
        if(strlen(first) > 80
        || strlen(second) > 80){
            printf("overflow\n");
            continue;
        }
        result = add(first, second);
        if(strlen(result) <= 80){
            printf("%s\n", result);
        }else{
            printf("overflow\n");
        }
        free(result);
    }
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	string x, y, temp;
	int i, a[80];

	cin >> N;

	for(i = 0;i < 80;i++){
		a[i] = 0;
	}

	while(N != 0){
		if(N == 0) break;
		cin >> x >> y;

		if(x.size() > 80 || y.size() > 80){
			cout << "overflow" << endl;
		}

		if(x.size() < y.size()){
			temp = x;
			x = y;
			y = temp;
		}
		int xi = 0, yi = 0, sum = 0;
		for(i = 0;i < x.size();i++){
			xi = x[x.size() - 1 - i] - '0';
			//cout << "xi = " << xi << endl;
			if(i >= y.size()){
				yi = 0;
			}
			else {
				yi = y[y.size() - 1 - i] - '0';
				//cout << "yi = " << yi << endl;
			}
			a[x.size() - 1 - i] += xi + yi;
			//cout << "xi + yi  = " << a[x.size() - 1 - i] << endl;
			if(a[x.size() - 1 - i] > 9){
				if(x.size() - 1 - i > 0){
					a[x.size() - 1 - i] = a[x.size() - 1 - i] - 10;
					a[x.size() - 1 - i - 1] += 1;
				}
				else if(x.size() - 1 - i < 0){
					cout << "overflow" << endl;
				}
			}
			
		}
		for(i = 0;i < x.size();i++){
			cout << a[i];
		}
		cout << endl;
		for(i = 0;i < 80;i++){
				a[i] = 0;
		}
		N--;
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    int n,g;
    int k,l;
    bool check;

    cin >> n;
    rep(i,n){
        char c1[81], c2[81];
        int i1[81] = {0}, i2[81] = {0};
        int ans[82] = {0};
        check = false;
        k = 0; l = 0;
        cin >> c1 >> c2;
        for(int j = 80; 0 <= j; j--){
            if(j <= strlen(c1) - 1){
                i1[k] = c1[j] - '0';
                k++;
            }
            if(j <= strlen(c2) - 1){
                i2[l] = c2[j] - '0';
                l++;
            }
        }
        rep(j, 80){
            ans[j]+= i1[j] + i2[j];
            if(ans[j] >= 10){
                ans[j]-=10;
                ans[j+1]++;
            }
        }
        if(ans[80] != 0){
            cout << "overflow";
        }else{
            for(int j = 81; 0 <= j; j--){
                if(ans[j] != 0){
                    check = true;
                }
                if(check == true)
                    cout << ans[j];
            }
        }
        cout << endl;
    }
}

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

int main(){
	string a,b;
	vector<int> sum;
	int al, bl, sl;
	int n, up, num;
	cin >> n;
	for(int i=0;i<n;++i){
		cin >> a >> b;
		al = a.size()-1;
		bl = b.size()-1;
		up = 0;
		while(al >= 0 || bl >= 0){
			num = up;
			if(al>=0) num += a[al] - 48;
			if(bl>=0) num += b[bl] - 48;
			if(num > 9){
				sum.push_back(num - 10);
				up = 1;
			}else{
				sum.push_back(num);
				up = 0;
			}
			al -= 1;
			bl -= 1;
		}
		sl = sum.size();
		if(sl > 80){
			cout << "overflow" << endl;
		}else{
			for(int j=sl-1;j>=0;--j){
				cout << sum[j];
			}
			cout << endl;
			sum.clear();
		}
	}
	return 0;
}