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 <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';

  // cout << "str1: " << str1 << endl;
  // cout << "str2: " << str2 << endl;
  }
}

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

    cin >> str1;
    //80????¶?????????´???
    if(str1.length() > 80){
      flag = true;
    }

    cin >> str2;
    //80????¶?????????´???
    if(str2.length() > 80){
      flag = true;
    }

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

    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;
    }


      // str1.pop_back();
      // str2.pop_back();
      // cout << "----" << endl;
      // cout << "i:" << i << endl;
      // cout << (int)(str1[str1.size()-i-1]-'0') << " + " << (int)(str2[str2.size()-i-1]-'0') << endl;
      // cout << "now:" << now << endl;
      // cout << "res:" << res << endl;


    // cout << "c:" << c << endl;

    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++: //0015
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n;
	cin>>n;
	while(n--){
		string a,b,ans;
		int tmp = 0,i;
		cin>>a>>b;
		while(a.size() != b.size()){
		if(a.size() > b.size()){
			while(a.size() != b.size()){
				b = '0' + b;
			}
		}

		else if(a.size() < b.size()){
			while(a.size() != b.size()){
				a = '0' + a;
			}
		}
		}

		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());

		for(i = 0;i < a.size()||i < b.size();i++){
			tmp = (int)(a[i] - '0') + (int)(b[i] - '0') + (int)tmp;
			ans = ((char)((tmp % 10)+'0')) + ans;

			tmp /= 10;
		}

		if((tmp + '0') != (char)'0')
			ans = (char)tmp + ans;

		if(ans.size() > 80)
			cout<<"overflow"<<endl;
		else
			cout<<ans<<endl;
	}
	return 0;
}

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 > 80 || m2 > 80)
      cout << "overflow" << endl;
    else if(atoi(str1) + atoi(str2) < 2147483647)
      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);
      }
      int ans[81];
      for(int i = ((m1 > m2) ? m1 : m2) - 1; i >= 0; i--)
	if((s1[i] - '0') + (s2[i] - '0') >= 10){
	  s1[i - 1] = s1[i - 1] + 1;
	  ans[i] = (s1[i] - '0') + (s2[i] - '0') - 10;
	}else
	  ans[i] = (s1[i] - '0') + (s2[i] - '0');
      if((s1[0] - '0') + (s2[0] - '0') >= 10)
     	cout << "1";
      for(int i = 0; i < ((m1 > m2) ? m1 : m2); i++)
	cout << ans[i];
    }
    cout << endl;
  }
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		string s1, s2;
		int l1, l2;
		cin >> s1 >> s2;
		l1 = s1.length();
		l2 = s2.length();
		if (l1>80 || l2 > 80)
			cout << "overflow" << endl;	
		else
		{
			int result[100], r = 0, m = max(l1, l2), t;
			reverse(s1.begin(), s1.end());
			reverse(s2.begin(), s2.end());
			s1.resize(m + 1, '0');
			s2.resize(m + 1, '0');
			for (int j = 0; j < m; j++)
			{
				t = r + s1[j] + s2[j] - 48 * 2;
				result[j] = t % 10;
				r = t / 10;
			}
			if (r == 1)
				result[m++] = 1;
			if (m>80)
				cout << "overflow" << endl;
			else
				for (int j = m - 1; j >= 0; j--)
					cout << result[j];
		}
		cout << endl;
	}
	return 0;
}

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

int main()
{
  int N;
  cin >> N;
  for(int i = 0; i < N; i++){
    char str1[1000];
    char str2[1000];
    string ans = "";
    cin >> str1;
    cin >> str2;
    int m1 = strlen(str1) - 1, m2 = strlen(str2) - 1, pre = 0;
    int m = max(m1, m2);
    for(int j = 0; j <= m; j++){
      int sum = pre;
      sum += (m1 >= 0) ? str1[m1--] - '0' : 0;
      sum += (m2 >= 0) ? str2[m2--] - '0' : 0;
      pre = sum / 10;
      sum -= pre * 10;
      ans += '0' + sum;
    }
    if(pre > 0)
      ans += '0' + pre;
    reverse(ans.begin(), ans.end());
    if(ans.length() > 80)
      cout << "overflow" << endl;
    else
      cout << ans << endl;
  }
}

C++: #include<iostream>
#include<cstring>
#include<cstdlib>
#include<stdio.h>
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;
            }
        }
        char c[3];
        for(int i=j ; i<81 ; i++){
            printf("%c",ans[i]+48);
        }
        cout << '\n';
    }
    return 0;
}