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 <algorithm>
#include <cstring>
using namespace std;

int main()
{
  int N;
  char str1[81];
  char str2[81];
  char s1[81];
  char s2[81];
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> str1;
    cin >> str2;
    int m1 = strlen(str1), m2 = strlen(str2);
    if(m1 > 79 || m2 > 79)
      cout << "overflow" << endl;
    else if(atoi(str1) + atoi(str2) < 2147483647 && atoi(str1) + atoi(str2) > 0)
      cout << atoi(str1) + atoi(str2) << endl; 
    else{
      if(m1 > m2){
	for(int i = 0; i < m1 - m2 + 1; i++)
	  s1[i] = '0';
	s1[m1 - m2] = '\0';
	strcat(s1, str2);
	strcpy(s2, str1);
      }else if(m2 > m1){
	for(int i = 0; i < m2 - m1; i++)
	  s2[i] = '0';
	s2[m2 - m1] = '\0';
	strcat(s2, str1);
	strcpy(s1, str2);
      }else{
	strcpy(s1, str2);
	strcpy(s2, str1);
      }
      char ans[81];
      int n = 0;
      for(int i = ((m1 > m2) ? m1 : m2) - 1; i >= 0; i--, n++)
	if((s1[i] - '0') + (s2[i] - '0') >= 10){
	  s1[i - 1] = s1[i - 1] + 1;
	  ans[i] = (s1[i]- '0') + (s2[i] - '0') + 38;
	}else
	  ans[i] = (s1[i] - '0') + (s2[i] - '0') + 48;
      if(n > 79)
	cout << "overflow" << endl;
      else{
	if((s1[0] - '0') + (s2[0] - '0') >= 10)
	  cout << "1";
	cout << ans;
      }
    }
  }
}

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

int chomp(char *str){
    int len = strlen(str);
    if(str[len-1]=='\n'){
        str[len-1] = '\0';
        len--;
    }
    return len;
}

int main(){
    int n;
    int i,j;
    int s1,s2,la,sm;
    char a1[103],a2[103],*pla,*psm,dummy[2];
    int carry,r;
    scanf("%d",&n);
    fgets(dummy,2,stdin);
    for(i=0;i<n;i++){
        fgets(a1,101,stdin);
        fgets(a2,101,stdin);
        s1 = chomp(a1);
        s2 = chomp(a2);
        if(s1>80||s2>80){
            printf("overflow\n");
            break;
        }
        if(s1<s2){
            pla = a2;
            la = s2;
            psm = a1;
            sm = s1;
        }else{
            pla = a1;
            la = s1;
            psm = a2;
            sm = s2;
        }
        carry = 0;
        for(j=0;j<la;j++){
            r = (j<sm) ? (psm[sm-j-1]-'0') : 0;
            r += (pla[la-j-1]-'0')+carry;
            carry = r/10;
            pla[la-j] = '0' + r%10;
        }
        if(carry){
            pla[0] = '1';
        }else{
            pla = (s1<s2) ? &a2[1] : &a1[1];
        }
        if(j+carry>80){
                printf("overflow\n");
                break;
        }
        printf("%s\n",pla);
    }
}

C++: #include <cstdlib>
#include <iostream>
#include <string>

#define MAX_DIGITS 80

int main(int argc, const char * argv[])
{
    using namespace std;
    string num1, num2, result;
    int count;
    cin >> count;
    for (int i = 0; i < count; ++i) {
        cin >> num1 >> num2;
        if (num1.size() > MAX_DIGITS || num2.size() > MAX_DIGITS) {
            result = "overflow";
        }
        else {
            int co = 0; // carryover
            reverse(num1.begin(), num1.end());
            reverse(num2.begin(), num2.end());
            size_t digits = max(num1.size(), num2.size()) + 1;
            result.resize(digits);
            for (int j = 0; j < digits; ++j) {
                string digit1, digit2;
                digit1 = j < num1.size() ? num1.substr(j, 1) : "0";
                digit2 = j < num2.size() ? num2.substr(j, 1) : "0";
                int tmp = atoi(digit1.c_str()) + atoi(digit2.c_str()) + co;
                co = tmp/10;
                result[j] = char(48 + tmp - co*10);
            }
            if (co == 1) result = "overflow";
            reverse(result.begin(), result.end());
            if (result[0] == '0') result = result.substr(1);
        }
        cout << result << endl;
    }
}

C++: #include<iostream>
#include<cstring>
#include<cstdlib>
using namespace std;

int main()
{
    int N,j;
    cin >> N;
    for(int i=0 ; i<N ; i++){
        int ans[81]={0};
        ans[0]=11111;
        char strA[100],strB[100];
        cin >> strA >> strB;
        if(strlen(strA)>80||strlen(strB)>80){
            cout << "overflow" << endl;
            continue;
        }
        char str1[strlen(strA)][2],str2[strlen(strB)][2];
        for(int i=0 ; i<strlen(strA) ; i++){
            str1[i][0]=strA[i];
            str1[i][1]='\0';
        }
        for(int i=0 ; i<strlen(strB) ; i++){
            str2[i][0]=strB[i];
            str2[i][1]='\0';
        }
        int a[81]={0},b[81]={0};
        j=strlen(strA)-1;
        for(int i=80 ; j>=0 ; i--){
            a[i]=atoi(str1[j]);
            j--;
        }
        j=strlen(strB)-1;
        for(int i=80 ; j>=0 ; i--){
            b[i]=atoi(str2[j]);
            j--;
        }
        for(int i=80 ; i!=0 ; i--){
            ans[i]=ans[i]+a[i]+b[i];
            if(ans[i]>=10){
                ans[i]=ans[i]-10;
                ans[i-1]++;
            }
        }
        if(ans[0]!=11111){
            cout << "overflow" << endl;
            continue;
        }
        for(int i=1 ; i<81 ; i++){
            if(ans[i]!=0){
                j=i;
                break;
            }
        }
        for(int i=j ; i<81 ; i++){
         cout << ans[i];
        }
        cout << '\n';
    }
    return 0;
}