Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

C++: #include <bits/stdc++.h>
using namespace std;
int main ()
{
    int n;
    cin>>n;
    getchar();
    while (n--)
    {
        string ara="",ara2="",res="";
        getline(cin,ara);
        getline(cin,ara2);

        if (ara.length()>ara2.length())
            swap(ara,ara2);

        int l1,l2;
        l1=ara.length();
        l2=ara2.length();

        reverse(ara.begin(),ara.end());
        reverse(ara2.begin(),ara2.end());

        int i,sum,carry=0;
        for (i=0;i<l1;i++)
        {
            sum=((ara[i]-'0')+(ara2[i]-'0')+carry);
            res.push_back((sum%10)+'0');
            carry=sum/10;
        }
        for (i=l1;i<l2;i++)
        {
            sum=(ara2[i]-'0')+carry;
            res.push_back((sum%10)+'0');
            carry=sum/10;
        }
        if (carry!=0)
            res.push_back(carry+'0');
        reverse (res.begin(),res.end());
        if (res.length()<=80)
            cout<<res;
        else
            cout<<"overflow";
        cout<<endl;
    }
    return 0;
}

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

int main(){
    int n,x=0,i;
    cin>>n;
    while(n--){
        string a,b,c="";
        cin>>a>>b;
        if(a.length()>b.length())swap(a,b);
        b='0'+b;
        while(a.length()<b.length())
            a='0'+a;
        char m;
        for(i=a.length()-1;i>0;i--){
            m=('0'+(a[i]-'0'+b[i]-'0'+x)%10);
            x=(a[i]-'0'+b[i]-'0'+x)/10;
            c=m+c;
        }
        if(x>0){
            m=('0'+x);
            c=m+c;
        }
        cout<<c<<endl;
    }
}

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

int main(){
	char a[800],b[800],wa[801],count;
	int N,i,ea,eb,c;
	
	scanf("%d",&N);
	while(N--){
		scanf(" %s ",a);
		scanf(" %s ",b);
		
		for(i=0;i<800;i++){
			if(a[i]=='\0')break;
		}
		ea=i;
		for(i=0;i<800;i++){
			if(b[i]=='\0')break;
		}
		eb=i;
		c=(ea<eb ? eb:ea);
		memset(wa,'0',sizeof(wa));
		wa[c+1]='\0';
		count=0;
		if(ea>eb){
			for(i=ea-1;i>=ea-eb;i--){
				wa[i+1]=a[i]-'0'+b[i-ea+eb]+count;
				count=0;
				if(wa[i+1]>=58){
					wa[i+1]=wa[i+1] - 10;
					count=1;
				}

			}
			
			for(i=ea-eb-1;i>=0;i--){
				wa[i+1]=a[i]+count;
				count=0;
				if(wa[i+1]>'9'){
					wa[i+1]=wa[i+1]-10;
					count=1;
				}
			}
		}else{
			for(i=eb-1;i>=eb-ea;i--){
				wa[i+1]=b[i]+a[i-eb+ea]+count-'0';
				count=0;
				if(wa[i+1]>=58){
					wa[i+1]=wa[i+1]-10;
					count=1;
				}

			}
			for(i=eb-ea-1;i>=0;i--){
				wa[i+1]=b[i]+count;
				count=0;
				if(wa[i+1]>'9'){
					wa[i+1]=wa[i+1]-10;
					count=1;
				}
			}
		}
		wa[0]=count+'0';
		if(wa[0]=='0'){
			for(i=0;i<=c;i++){
				wa[i]=wa[i+1];
			}
			c=c-1;
		}
		if(c>79){
			printf("overflow\n");
		}else{
			printf("%s\n",wa);
		}
	}
	return 0;
}

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

int main()
{
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		int p1[100],p2[100];
		for(int i=0;i<100;i++){
			p1[i] = 0; p2[i] = 0;
		}
		string a,b;
		cin >> a ;
		cin >> b ;
		if(a.size() > 80 || b.size() > 80){
			cout << "overflow" << endl;
			continue;
		}

		int pos = 0;
		for(unsigned i=a.size();i>0;i--){
			stringstream sst;
			sst << a[i-1];
			sst >> p1[pos++];
		}
		pos = 0;
		for(unsigned i=b.size();i>0;i--){
			stringstream sst;
			sst << b[i-1];
			sst >> p2[pos++];
		}
		for(int i=0;i<100;i++){
			int ans = p1[i]+p2[i];
			p1[i] = ans % 10;
			p1[i+1] += ans/10;
		}
		bool flag = true;
		for(int i=99;i>=0;i--){
			if(flag){
				if(i != 0 && p1[i] == 0)
					continue;
				else{
					if(i > 79){
						cout << "overflow" ;
						break;
					}
					flag = false;
				}
			}
			cout << p1[i];
		}
		cout << endl;
	}
	return 0;
}

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

using namespace std;

int main(void){
	int n = 0;
	char i1[100], i2[100], o[100];
	string si1, si2;
	int l1, l2;
	int t=0, c=0;
	stack<char> sum;

	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%s", i1);
		scanf("%s", i2);
		si1 = string(i1);
		si2 = string(i2);
		l1 = si1.size();
		l2 = si2.size();

		if(l1 > 80 || l2 > 80){
			puts("overflow");
			continue;
		}

		--l1;
		--l2;
		c = 0;
		sum = stack<char>();
		while(l1 >= 0 || l2 >= 0){
			t = c;
			if(l1 >= 0){ t += (si1[l1] - '0'); }
			if(l2 >= 0){ t += (si2[l2] - '0'); }
			c = t / 10;
			t -= c * 10;
			sum.push((char)(t + '0'));
			--l1;
			--l2;
		}
		if(c == 1){ sum.push((char)(c + '0')); }
		if(sum.size() > 80){
			puts("overflow");
			continue;
		}
		while(!sum.empty()){
			printf("%c", sum.top());
			sum.pop();
		}
		printf("\n");
	}
	return 0;
}