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 <iostream>
#include <vector>
#include <cstring>
using namespace std;

int main(){
	int n;
	cin >> n;
	while( n-- > 0 ){
		string num1, num2;
		cin >> num1 >> num2;
		char sum[101];
		int degit = 0;
		for( int i = 0; i < 101; i++ ) sum[i] = '0';
		for( int i = 0; i < num1.size(); i++ ){
			sum[100-i] = num1[num1.size()-i-1];
		}
		int d;
		for( int i = 0; i < num1.size() || i < num2.size() || degit != 0; i++ ){
			int now;
			if( i < num2.size() ){
				now = (int)(sum[100-i]-'0') + (int)(num2[num2.size()-i-1]-'0') + degit;
			}else{
				now = (int)(sum[100-i]-'0') + degit;
			}
			sum[100-i] = (char)((char)(now%10)+'0');
			if( now >= 10 ) degit = 1;
			else degit = 0;
			d = i;
		}
		for( int i = 100-d; i < 101; i++ ) cout << sum[i];
		cout << endl;
	}
}

C++: #include <stdio.h>
#include <string.h>
#define N 80

int main(void){
    char buf[N+1];
    int datas;
    int degits;
    int lint1[N+1], lint2[N+1], sum[N+1];
    int cry;
    
    scanf("%d", &datas);
    for (int n=0; n<datas; n++){
        // reset
        for (int i=0; i<N; i++) lint1[i]=lint2[i]=0;
        // input
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint1[degits-i-1]= buf[i]-'0';
        }
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint2[degits-i-1]= buf[i]-'0';
        }
        // calc
 /*       cry=0;
        for (int i=0; i<N; i++){
            sum[i] = lint1[i]+lint2[i] + cry;
            cry = sum[i]>9 ? 1:0;
            if (cry) sum[i] -= 10;
        }
   */     // output
        if (cry){
            puts("overflow");
        } else {
            bool zero=true;
            if (cry) puts("1");
            for (int i=N-1; i>=0; i--){
                if (zero && sum[i] != 0) zero=false;
                if (!zero) printf("%d", sum[i], i);
            }
            printf("\n");
        }
        
    }
    
    return 0;
}

C++: #include <iostream>
#include <cstring>
#define N 10000
using namespace std;
void mpstr2num(int *num, char *str);
void mpadd(int* ret, int* a, int* b);
void mpnum2str(char* str, int* num);

char a[100], b[100];
int anum[25], bnum[25];
int resultnum[25];
char result[100];

void mpstr2num(int* num, char* str){
    char* ss;
    int* nn;
    while(*str == ' ' || *str == '\t') str++;
    while(*str == '0') str++;
    ss = str;
    while(*ss >= '0' && *ss <= '9') ss++;
    if(ss == str){
        *num = 0;
        return;
    }
    int x = 0;
    int k = 1;
    nn = num;
    do{
        x+=(*--ss - '0') * k;
        k *= 10;
        if(k == N || ss == str){
            *++nn = x;
            x = 0;
            k = 1;
        }
    }while(ss != str);

    *num = nn - num;
    return;
}

void mpadd(int* ret, int* a, int* b){
    int la = *a;
    int lb = *b;
    int lr = (la >= lb) ? la : lb;
    int* rr = ret;
    int x = 0;
    for(int i=1; i<= lr; i++){
        if(i <= la) x += *++a;
        if(i <= lb) x += *++b;
        if(x < N){
            *++rr = x;
            x = 0;
        }else{
            *++rr = x - N;
            x = 1;
        }
    }
    *++rr = x;
    *ret = lr + x;
    return;
}

void mpnum2str(char* str, int* num){
    if(*num == 0){
        *str++ = '0';
        *str = '\0';
        return;
    }
    char* ss = str - 1;
    int x;
    for(int i=*num; i>0; i--){
        x = *++num;
        for(int j=1; j<N; j*=10){
            *++ss = x%10 + '0';
            x /= 10;
        }
    }    while(*ss == '0') ss--;
    *(ss+1) = '\0';
    while(str < ss){
        x = *str;
        *str++ = *ss;
        *ss-- = x;
    }
    return;
}

int main(){
    int n;
    cin >> n;
    for(int i=1; i<=n; i++){
        cin >> a >> b;
        if(strlen(a) > 80 || strlen(b) > 80){
            cout << "overflow" << endl;
            continue;
        }
        mpstr2num(anum, a);
        mpstr2num(bnum, b);
        mpadd(resultnum, anum, bnum);
        mpnum2str(result, resultnum);
        if(strlen(result) > 80){
            cout << "overflow" << endl;
            continue;
        }else{
            cout << result << endl;
        }
    }
    return 0;
}