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 <stdio.h>
#include <stdlib.h>
#include <string.h>


//¶ñðtÉ·éÖ
void reverseString(char *str){
	char *hoge;
	int length;

	hoge = (char *)malloc( sizeof(char) * strlen(str) );
	
	length = strlen(str);
	for(int i=0 ; i<length ; i++){
		hoge[length-i-1] = str[i];
	}
	for(int i=0 ; i<length ; i++){
		str[i] = hoge[i];
	}
	free(hoge);
}

int main(){
	char a[1000], b[1000], c[1000];
	int n, num1, num2, index;
	bool flag, printFlag;

	//f[^ZbgÌüÍ
	scanf("%d", &n);
	
	for(int i=0 ; i<n ; i++){
		//ÏÌú»
		for(int j=0 ; j<1000 ; j++){
			a[j] = 0;
			b[j] = 0;
			c[j] = 0;
		}
		flag = false;

		//QÂÌlðüÍ(¶ñÆµÄzñÉi[)
		scanf("%s", a);
		scanf("%s", b);

		//QÂÌlÌªáÁÄàvZÅ«éæ¤É¶ñðtÉ·é
		reverseString(a);
		reverseString(b);
		//QÂÌlª80ð´¦Ä¢½çtOð§Äé
		if( strlen(a)>80 || strlen(b)>80){
			flag = true;
		}
		
		//aðvZ·é
		for(int j=0 ; j<100 ; j++){
			if(flag) break;

			//48ø¢Ä¶ñ©çlÉÏ··é
			if(a[j]>=48)a[j] -= 48;
			if(b[j]>=48)b[j] -= 48;

			if( (a[j]+b[j]+c[j]) >= 10 ){//Jèãªè
				c[j+1]++;
			}
			c[j] += (a[j]+b[j])%10;
			c[j] %= 10;
		}
		//ÅãÊª½Ú©²×é
		for(int j=79 ; j>=0 ; j--){
			if(c[j] != 0){
				index = j;
				break;
			}
		}
		for(int j=0 ; j<index ; j++){
			if(c[j]==0)c[j] += 48;
		}
		reverseString(c);
		if(strlen(c)>80){
			flag = true;
		}
		for(int j=0 ; j<=index ; j++){
			if( flag==false ){
				if(c[j]==48) c[j] = 0;
				printf("%d", c[j]);
			}
		}
		if(flag){
			printf("overflow");
		}
		printf("\n");
	}
	return 0;
}

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;
}