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 sum(char a[],char b[],int as,int bs,char c[]){
	int cs = (as>bs) ? as + 1 : bs + 1;
	int size = cs;
	while(as >=0 && bs >=0){
		c[cs] = a[as] + b[bs];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		as--;bs--;cs--;
	}
	while(as >=0){
		c[cs] += a[as];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		as--;cs--;
	}
	while(bs >=0){
		c[cs] += b[bs--];
		if(c[cs]>9){
			c[cs] -= 10;
			c[cs-1] += 1;
		}
		cs--;
	}
	return (c[0]>0) ? size + 1 : size;
}

int main(){
	char a[256],b[256],c[256];
	bool flag = true;
	int len1,len2,len3,n;
	scanf("%d",&n);
	while(n--){
		scanf("%s",a);
		scanf("%s",b);
		len1 = strlen(a);
		len2 = strlen(b);
		if(len1 > 80 || len2 >80){
			printf("overflow\n");
			continue;
		}
		for(int i=0;i<len1;i++) a[i] -= 0x30;
		for(int i=0;i<len2;i++) b[i] -= 0x30;
		for(int i=0;i<256;i++)  c[i] = 0;
		len3 = sum(a,b,len1-1,len2-1,c);
		if(len3>80){
			printf("overflow\n");
			continue;
		}
		if(c[0]>0) for(int i=0;i<len3;i++) printf("%d",c[i]);
		else for(int i=1;i<=len3;i++) printf("%d",c[i]);
		printf("\n");
	}
	return 0;
}

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

int main(){
	int n;
	cin>>n;
	for(int i=0; i<n; i++){
		string a, b;
		cin>>a>>b;
		int kuri = 0;
		int k = 0;
		string ans = "";
		while(true){
			bool breakflg = true;
			int ai = 0;
			int bi = 0;
			if(int(a.size())-k-1 >= 0){
				ai = a[int(a.size())-k-1] - '0';
				breakflg = false;
			}
			if(int(b.size())-k-1 >= 0){
				bi = b[int(b.size())-k-1] - '0';
				breakflg = false;
			}
			k++;
			int sum = ai + bi + kuri;
			if(!kuri&&breakflg) break;
			if(sum>9){
				kuri = 1;
				sum %= 10;
			} else {
				kuri = 0;
			}
			ans.push_back('0'+sum);
		}
		reverse(ans.begin(), ans.end());
		if(ans.size()>80){
			cout<<"overflow"<<endl;
		} else {
			cout<<ans<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>

using namespace std;

int main(){
	int N; cin >> N;
	for(int i = 0; i < N; i++){
		long double a, b;
		cin >> a >> b;
		if(log10(a + b) >= 80){
			cout << "overflow" << endl; 
		}else{
			cout << a + b << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl

typedef long long ll;
using namespace std;

double nextDouble() {
	double d = -1;
	cin >> d;
	return d;
}

int nextInt() {
	int n = -1;
	cin >> n;
	return n;
}

string nextString() {
	string str;
	cin >> str;
	return str;
}

string reverse(string str) {
	string t = str;
	for (int i = 0; i < str.size(); i++) {
		t[i] = str[str.size() - i - 1];
	}
	return t;
}

int main() {
	cin.tie(0); //対話型には使えない
	int n = nextInt();
	while (n--) {
		string str1 = nextString();
		if (str1.size() > 80) {
			cout << "overflow" << endl;
			continue;
		}
		string str2 = nextString();
		if (str2.size() > 80) {
			cout << "overflow" << endl;
			continue;
		}
		str1 = reverse(str1);
		str2 = reverse(str2);
		char ans[82];
		int m = max(str1.size(), str2.size());
		int k = 0;
		int i;
		for (i = 0; i < m; i++) {
			int t = 0;
			if (i < str1.size()) {
				t += str1[i] - '0';
			}
			if (i < str2.size()) {
				t += str2[i] - '0';
			}
			t += k;
			ans[i] = (t % 10) + '0';
			k = t / 10;
		}
		if (k != 0) {
			if (i > 80) {
				cout << "overflow" << endl;
				continue;
			}
			ans[i] = k + '0';
			ans[i + 1] = '\0';
		} else {
			ans[i] = '\0';
		}
		cout << reverse(ans) << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
string a,b;
int s,cop,copp,last,n;
int main(){
    cin>>n;
    for(int l=0;l<n;l++){
        int latte[81]={0},cafe[81]={0},all[81]={0};
        cin>>a>>b;
        if(a.size()>b.size()){
            s=a.size();
            cop=a.size(),copp=b.size(),last=s;
        }
        else {
            s=b.size();
            cop=a.size(),copp=b.size(),last=s;
        }
        for(int i=0;i<a.size();i++){
            cop--;
            if(a[i]=='0')latte[cop]=0;
            if(a[i]=='1')latte[cop]=1;
            if(a[i]=='2')latte[cop]=2;
            if(a[i]=='3')latte[cop]=3;
            if(a[i]=='4')latte[cop]=4;
            if(a[i]=='5')latte[cop]=5;
            if(a[i]=='6')latte[cop]=6;
            if(a[i]=='7')latte[cop]=7;
            if(a[i]=='8')latte[cop]=8;
            if(a[i]=='9')latte[cop]=9;
            }
        for(int i=0;i<b.size();i++){
            copp--;
            if(b[i]=='0')cafe[copp]=0;
            if(b[i]=='1')cafe[copp]=1;
            if(b[i]=='2')cafe[copp]=2;
            if(b[i]=='3')cafe[copp]=3;
            if(b[i]=='4')cafe[copp]=4;
            if(b[i]=='5')cafe[copp]=5;
            if(b[i]=='6')cafe[copp]=6;
            if(b[i]=='7')cafe[copp]=7;
            if(b[i]=='8')cafe[copp]=8;
            if(b[i]=='9')cafe[copp]=9;
            }
         for(int i=0;i<=s;i++){
            all[i]+=latte[i]+cafe[i];
            if(all[i]>9){
                all[i]-=10;
                all[i+1]+=1;
            }
         }
         for(int i=s-1;i>-1;i--){
            if(all[last]!=0)cout<<all[last];
            cout<<all[i];
            all[last]=0;
         }
         cout<<endl;
    }
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

int N,ans[1001],a,b,la,lb,up,deg;
string sta,stb;

int main(){
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>sta>>stb;
		la=sta.size();
		lb=stb.size();
		up=0;
		for(int i=0;i<max(la,lb)+1;i++){
			if(i>=la)a='0';
			else a=sta[la-1-i];
			if(i>=lb)b='0';
			else b=stb[lb-1-i];
			if(a+b+up>105){
				ans[i]=a+b+up-10-96;
				up=1;
			}
			else{
				ans[i]=a+b+up-96;
				up=0;
			}
			if(ans[i]!=0)deg=i+1;
		}
		if(deg>80)cout<<"overflow"<<endl;
		else{
			for(int i=0;i<deg;i++)cout<<ans[deg-1-i];
			cout<<endl;
		}
	}
}

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

int main(void){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		string a,b,ans;
		cin >> a;
		cin >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		int c=0;
		for(int j=0;j<max(a.size(),b.size());j++){
			string d;
			int e;
			e=c;
			if(a.size()>j)e+=a[j]-'0';
			if(b.size()>j)e+=b[j]-'0';
			c=0;
			if(e>=10)c=1,e-=10;
			d=e+'0';
			ans+=d;
		}
		reverse(ans.begin(),ans.end());
		if(ans.size()<=80)cout << ans << endl;
		else cout << "overflow" << endl;
	}
    return 0;
}