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 <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	string x, y, temp;
	int i, a[80];

	cin >> N;

	for(i = 0;i < 80;i++){
		a[i] = 0;
	}

	while(N != 0){
		if(N == 0) break;
		cin >> x >> y;

		if(x.size() > 80 || y.size() > 80){
			cout << "overflow" << endl;
		}

		if(x.size() < y.size()){
			temp = x;
			x = y;
			y = temp;
		}
		int xi = 0, yi = 0, sum = 0;
		for(i = 0;i < x.size();i++){
			xi = x[x.size() - 1 - i] - '0';
			//cout << "xi = " << xi << endl;
			if(i >= y.size()){
				yi = 0;
			}
			else {
				yi = y[y.size() - 1 - i] - '0';
				//cout << "yi = " << yi << endl;
			}
			a[i] += xi + yi;
			//cout << "xi + yi  = " << a[x.size() - 1 - i] << endl;
			if(a[i] > 9){
				if(i < 79){
					a[i] = a[i] - 10;
					a[i + 1] += 1;
				}
				else if(i >= 79){
					cout << "overflow"	<< endl;				
				}
			}

			
		}
		bool start = false;
		for(i = 79;i >= 0;i++){
			if(!start && a[i] > 0){
				start = true;
			}
			else if(start){
				cout << a[i];
			}
		}
		cout << endl;
		for(i = 0;i < 80;i++){
				a[i] = 0;
		}
		N--;
	}
	return 0;
}

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

int c[100];

void add(char*a, char*b)  //鮟倩ョ、a豈巴髟ソ
{
    fill(c,c+100,0);      //蜥檎噪蜷?ス咲スョ髮カ
    int la=strlen(a), lb=strlen(b);
        for(int i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス?        {
            c[i]+=a[i-1]-'0'+b[j-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        for(int i=la-lb;i>0;i--)
        {
            c[i]+=a[i-1]-'0';
            if(c[i]>9)
            {
                c[i]-=10;
                c[i-1]++;
            }
        }
        if(la==80&&c[0]==1) printf("overflow\n");
        else
        {
            if(c[0]==0)
            {
                for(int i=1;i<=la;i++)
                    printf("%d",c[i]);
                printf("\n");
            }
            else
            {
                for(int i=0;i<=la;i++)
                   printf("%d",c[i]);
                printf("\n");
            }
        }
}

int main()
{
    char a[100], b[100];
    int n;
    scanf("%d",&n);

    while(n--){
    scanf("%s%s",a,b);
    int la = strlen(a), lb = strlen(b);
    if(la>80 || lb>80)
        printf("overflow\n");
    else if(la>lb)
        add(a,b);
    else add(b,a);
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
using namespace std;
string toStr(int n) {
    ostringstream os; os << n;
    return os.str();
}
string add(string a, string b) {
    while (a.size() > b.size()) b = "0" + b;
    while (b.size() > a.size()) a = "0" + a;
    string res = "";
    int carry = 0;
    for (int i=a.size()-1; i>=0; --i) {
        int t = (a[i] - '0') + (b[i] - '0') + carry;
        res = toStr(t % 10) + res;
        carry = t / 10;
    }
    if (carry) res = "1" + res;

    return (res.size() <= 80) ? res : "overflow";
}
int main() {
    int n; cin >> n;
    string a, b;
    while (n--) {
        cin >> a >> b;
        cout << add(a, b) << endl;
    }
    return 0;
}

C++: #include <stdio.h>

#define N 80

// Longint <- String
void init(int a[], char s[]);
// a <- b + c
int add(int a[], int b[], int c[]);
// print Longint
void print(int a[]);

int main(void){
	int n;
	int a[N], b[N], sum[N];
	char s[101];
	
	for (int i=0; i<n; i++){
		scanf("%s", s);
		init(a, s);
		scanf("%s", s);
		init(b, s);
		if (add(sum, a, b)==-1){
			puts("overflow");
		} else {
			print(sum);
		}
	}
	return 0;
}

// Longint <- String
void init(int a[], char s[]){
	int len=0;
	
	for (int i=0; i<N; i++) a[i] = 0;
	for (char *p=s; *p!='\0'; p++) len++;
	for (int i=0; s[i]!='\0'; i++){
		a[N-len+i] = s[i] - '0';
	}
}
// a <- b + c
int add(int a[], int b[], int c[]){
	int cry=0;
	for (int i=N-1; i>=0; i--){
		a[i] = b[i]+c[i]+cry;
		cry = a[i]/10;
		a[i] %= 10;
	}
	return cry ? -1 : 0;
}

// print Longint
void print(int a[]){
	int i;
	for (i=0; i<N && a[i]==0; i++)
	;
	if (i==N){
		puts("0");
		return;
	} else {
		for (; i<N; i++){
			printf("%d", a[i]);
		}
		puts("");
	}
}