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 <string>

using namespace std;

int main() {
    int N;
    cin >> N;
    while(N--) {
        string s1, s2;
        cin >> s1 >> s2;

        if(s1.size() > 80 || s2.size() > 80) {
            cout << "overflow" << endl;
            continue;
        }
        char buf[81] = {0};
        int p1 = s1.size()-1, p2 = s2.size()-1, pb = 79;
        int carry = 0;
        while(p2 >= 0) buf[pb--] = s2[p2--];
        pb = 79;
        while(p1 >= 0) {
            int bd = buf[pb];
            if(bd > 0) bd -= '0';
            int d = s1[p1--]-'0' + bd + carry;
            carry = d / 10;
            d %= 10;
            buf[pb--] = d+'0';
        }
        if(pb == -1 && carry > 0) cout << "overflow" << endl;
        else {
            if(carry > 0) buf[pb--] = carry+'0';
            cout << (char*)(buf+(pb+1)) << endl;
        }
    }
    return 0;
}

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

#define BUF_SIZE 256

int main(void) {
	char buf[BUF_SIZE];
	char num1[100];
	char num2[100];
	char sum[100];
	char str[100];
	int n;
	int i, j, k;
	
	fgets(buf, sizeof(buf), stdin);
	sscanf(buf, "%d", &n);
	
	for (i=0; i<n; i++) {
		for (j=0; j<100; j++) {
			num1[j] = num2[j] = sum[j] = 0;
		}
		
		// first integer
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		if (strlen(str) > 80) {
			printf("overflow\n");
			continue;
		}
		
		for (j=0; j<strlen(str); j++)  ;
		for (k=0; j>0; k++) {
			j--;
			num1[k] = str[j] - '0';
		}
		
		// second integer
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		if (strlen(str) > 80) {
			printf("overflow\n");
			continue;
		}
		
		for (j=0; j<strlen(str); j++)  ;
		for (k=0; j>0; k++) {
			j--;
			num2[k] = str[j] - '0';
		}
		
		// sum
		for (j=0; j<80; j++) {
			sum[j] += num1[j]+num2[j];
			if (sum[j] >= 10) {
				sum[j+1]++;
				sum[j] = sum[j]%10;
			}
		}
		
		if (sum[80] != 0) {
			printf("overflow\n");
		}
		else {
			for (j=79; sum[j]==0; j--)  ;
			for (; j>=0; j--) {
				printf("%d", sum[j]);
			}
			printf("\n");
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
#define repeat(i,n) for (int i = 0; i < (n); ++i)
#define MAX_DIGIT (80)
int d[MAX_DIGIT+1];
int main() {
    int N; cin >> N;
    repeat (test,N) {
        fill(d,d+MAX_DIGIT+1,0);
        repeat (i,2) {
            string s; cin >> s;
            if (80 < s.length()) {
                cout << "overflow" << endl;
                if (i == 0) cin >> s;
                goto next;
            }
            repeat (j,(int)s.length()) {
                d[j] += s[s.length()-1-j] - '0';
            }
        }
        repeat (i,MAX_DIGIT) {
            d[i+1] += d[i] / 10;
            d[i] %= 10;
        }
        if (d[MAX_DIGIT] != 0) {
            cout << "overflow" << endl;
        } else {
            int i = MAX_DIGIT;
            while (d[i] == 0) -- i;
            for (; 0 <= i; --i) cout << d[i];
            cout << endl;
        }
next: ;
    }
    return 0;
}

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

int main(){

	int n, s, t, cnt1, cnt2;
	string str1, str2, str3;

	cin >> n;
	
	for(int i=0; i<n; i++){
		cin >> str1 >> str2;

		str3 = "";
		cnt1 = str1.length() - 1;
		cnt2 = str2.length() - 1;
		if(cnt1 > 80 || cnt2 > 80){
			cout << "overflow" << endl;
			continue;
		}
		t = 0;
		while(cnt1 >= 0 || cnt2 >= 0){
			s = t;
			if(cnt1 >= 0) s += str1[cnt1] - '0';
			if(cnt2 >= 0) s += str2[cnt2] - '0';
			str3 += '0' + s % 10;
			t = (s - s % 10) / 10;
			cnt1--;
			cnt2--;
		}
		if(t != 0) str3 += '0' + t;
		
		if(str3.length() > 80){
			cout << "overflow" << endl;
			continue;
		}
		
		for(int j=str3.length() - 1; j>=0; j--){
			cout << str3[j];
		}
		cout << endl;
	}

  return 0;
}