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<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
int main(){
    int n;
    scanf("%d\n",&n);
    for(int ix=0;ix<n;ix++){
        char t1[85],t2[85];
        scanf("%s\n%s\n",t1,t2);
        string s1(t1),s2(t2);
        reverse(s1.begin(),s1.end());
        reverse(s2.begin(),s2.end());
        string res;
        int kuri=0;
        for(int i=0;i<80;i++){
            int now;
            if(i<s1.size()&&i<s2.size())now=(s1[i]-'0')+(s2[i]-'0')+kuri;
            else if(i<s1.size())now=(s1[i]-'0')+kuri;
            else if(i<s2.size())now=(s2[i]-'0')+kuri;
            else if(kuri==1)now=kuri;
            else continue;
            res.append(1,(char)(now%10+'0'));
            kuri=now/10;
        }
        if(kuri==1)printf("overflow\n");
        else{
            reverse(res.begin(),res.end());
            printf("%s\n",res.c_str());
        }
    }
}

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

int a[85],b[85];

int reverse(int *p,int length)
{
	int i,t;

	for(i=1;i<=length/2;i++)
	{
		t=p[i];
		p[i]=p[length+1-i];
		p[length+1-i]=t;
	}

	return 0;
}

int main()
{
	int N,i,la,lb,lmax,carry,t;
	char ch;
	
	scanf("%d%*c",&N);
	
	while(N--)
	{
		la=0;
		lb=0;
		carry=0;
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));

		while(1)
		{
			ch=getchar();

			if(ch>='0'&&ch<='9')
			{
				la++;
				a[la]=ch-'0';
			}

			else if(ch=='\n')
			{
				break;
			}
		}
	
		while(1)
		{
			ch=getchar();
			
			if(ch>='0'&&ch<='9')
			{
				lb++;
				b[lb]=ch-'0';
			}

			else if(ch=='\n')
			{
				break;
			}
		}
	
		if(la>80||lb>80)
		{
			printf("overflow\n");
			continue;
		}

		reverse(a,la);
		reverse(b,lb);

		lmax=la>lb?la:lb;

		for(i=1;i<=lmax+1;i++)
		{
			t=a[i];
			a[i]=(t+b[i]+carry)%10;
			carry=(t+b[i]+carry)/10;
		}

		for(i=lmax+1;i>=1;i--)
		{
			if(a[i]!=0)
			{
				t=i;
				break;
			}
		}

		if(t>80)
		{
			printf("overflow\n");
			continue;
		}

		if(i==0)
		{
			printf("0\n");
			continue;
		}

		for(i=t;i>=1;i--)
		{
			printf("%d",a[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 s1, s2;
		int l1, l2;
		cin >> s1 >> s2;
		l1 = s1.length();
		l2 = s2.length();
		if (l1>80 || l2 > 80)
			cout << "overflow";
		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";
			else
				for (int j = m - 1; j >= 0; j--)
					cout << result[j];
		}
		cout << endl;
	}
	return 0;
}

C++: #include<stdio.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);

		sum=x+y;
		int keta;
		keta=sum/10;
		for(m=1;m<79;m++)
		{
			keta=keta/10;
		}

		if(keta>=0)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%d",sum);
		}
	}
	return 0;
}