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 <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cmath>
#include <complex>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <map>
#include <valarray>
#include <list>

using namespace std;

typedef long long ll;

int main() {
    int t;
    cin >> t;
    while (t--) {
        string s1, s2;
        cin >> s1 >> s2;
        if (s1 == "0" && s2 == "0") {
            cout << "0" << endl;
            continue;
        }
        reverse(s1.begin(), s1.end());
        reverse(s2.begin(), s2.end());
        int n = max(s1.size(), s2.size()) + 1;
        for (int i = s1.size(); i < n; i++) {
            s1 += '0';
        }
        for (int i = s2.size(); i < n; i++) {
            s2 += '0';
        }
        string res;
        int b = 0;
        for (int i = 0; i < max(s1.size(), s2.size()); i++) {
            int u = s1[i]-'0'+s2[i]-'0'+ b;
            b = (u >= 10); u %= 10;
            res += u + '0';
        }
        reverse(res.begin(), res.end());
        string res2;
        int j = 0;
        while (res[j] == '0') j++;
        for (; j < res.size(); j++) {
            res2 += res[j];
        }
        if (res2.size() >= 80) {
            cout << "overflow" << endl;
        } else {
            cout << res2 << endl;
        }
    }
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		/*
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[m_len]!=0){
			if(m_len>79){
				cout<<"overflow"<<endl;
				continue;
			}
			cout<<ans[m_len];
		}
		for(int i=0;i<m_len;i++){
			cout<<ans[m_len-1-i];
		}cout<<endl;
		
		*/
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <stack>

using namespace std;

int main (int argc, char * const argv[]) {
    // insert code here...
	int n;
    string a, b;
		
	cin>> n;	
	for(int i=0;i<n;i++){
		int x[81]={0}, y[81]={0};

		cin >> a;
		cin >> b;
		
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		
		for(int j=0;j<a.size();j++){
			x[j]=a[j]-'0';
		}
		for(int j=0;j<b.size();j++){
			y[j]=b[j]-'0';
		}
		
		for(int j=0;j<80;j++){
			x[j]=x[j]+y[j];
			if(x[j]>=10){
				x[j+1]++;
				x[j]-=10;
			}
		}
		//cout << 0 << endl;
		
		if(x[80]!=0){
			cout << "overflow" <<endl;
		}else{
			bool flag = 0;
			for(int j=79;j>=0;j--){
				if(x[j]==0&& flag==0){
					continue;
				}else{
					flag=1;
				}
				cout<<x[j];
			}
			cout<<endl;
			
			cout<<0<<endl;
		}
		
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int n;
int main()
{
	cin>>n;
	for(;n--;)
	{
		string s,t,u="";cin>>s>>t;
		if(s.size()<t.size())swap(s,t);
		int a=0;
		for(int i=0;i<s.size();i++)
		{
			a+=s[s.size()-i-1]-48;
			if(i<t.size())a+=t[t.size()-i-1]-48;
			u+=a%10+48;
			a/=10;
		}
		if(a)u+=a+48;
		if(u.size()>80)
		{
			cout<<"overflow"<<endl;
		}
		else
		{
			for(int i=u.size();i--;)cout<<u[i];
			cout<<endl;
		}
	}
}

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

int main(void)
{
	int x,y,n,m,sum;
	scanf("%d",&n);

	for(int t=0;t<n;t++)
	{
		scanf("%d",&x);
		scanf("%d",&y);

		m=10^80;
		sum=x+y;
		
		if(sum>m)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%d",sum);
		}
	}
	return 0;
}

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

void reverseString(char *str){
	char *hoge;
	int length;

	hoge = (char *)malloc( sizeof(char) * strlen(str) );
	
	length = strlen(str);
	for(int i=0 ; i<length ; i++){
		hoge[length-i-1] = str[i];
	}
	for(int i=0 ; i<length ; i++){
		str[i] = hoge[i];
	}
	free(hoge);
}

int main(){
	char a[1000], b[1000], c[1000];
	int n, num1, num2, index;
	bool flag, printFlag;

	scanf("%d", &n);
	for(int i=0 ; i<n ; i++){
		//ÏÌú»
		for(int j=0 ; j<1000 ; j++){
			a[j] = 0;
			b[j] = 0;
			c[j] = 0;
		}
		flag = false;
		printFlag = false;

		//QÂÌlðüÍ(¶ñÆµÄzñÉi[)
		scanf("%s", a);
		scanf("%s", b);

		//QÂÌlÌªáÁÄàvZÅ«éæ¤É¶ñðtÉ·é
		reverseString(a);
		reverseString(b);
		//QÂÌlª80ð´¦Ä¢½çtOð§Äé
		if( strlen(a)>80 || strlen(b)>80){
			flag = true;
		}
		//aðvZ·é
		for(int j=0 ; j<100 ; j++){
			if(flag) break;

			//48ø¢Ä¶ñ©çlÉÏ··é
			if(a[j]>=48)a[j] -= 48;
			if(b[j]>=48)b[j] -= 48;
			
			c[j] += (a[j]+b[j])%10;
			if( (a[j]+b[j]) >=10 ){//Jèãªè
				c[j+1]++;
			}
		}
		if(strlen(c)>80){
			flag = true;
		}
		for(int j=79 ; j>=0 ; j--){
			if(c[j] != 0){
				index = j;
				break;
			}
		}
		reverseString(c);
		for(int j=0 ; j<=index ; j++){
			if( (c[j]!=0 || printFlag==false) && flag==false){
				printFlag = true;
				printf("%d", c[j]);
			}
		}
		if(flag){
			printf("overflow");
		}
		printf("\n");
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>

using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;


int main()
{
	int n;
	cin >> n;
	REP(i, n){
		string a, b;
		int a_a[100] = { 0 };
		int b_a[100] = { 0 };
		int c_a[100] = { 0 };
			cin >> a >> b;
			if (a.length() > 80 || b.length() > 80){
				cout << "overflow" << endl;
				continue;
			}

			REP(i, a.length()){
				a_a[i] = a[a.length() - i -1] - '0';
			}
			
			REP(i, b.length()){
				b_a[i] = b[b.length() - i -1] - '0';
			}

			REP(i, 84){
				int temp = a_a[i] + b_a[i] + c_a[i];
				c_a[i + 1] += temp / 10;
				c_a[i] = temp % 10;
			}

			int i = 84;

			while (!c_a[i] && i){
				--i;
			}
			if (i > 80){
				cout << "overflow" << endl;
				continue;
			}

			while (i >= 0){
				cout << c_a[i];
				--i;
			}
			cout << endl;
		}

	return 0;
}