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 <sstream>
#include <cstring>

using namespace std;

int main()
{
	stringstream ss;
	string str;
	int n;
	long long num;
	
	cin >> n;
	while (n != 0){
		int sum = 0;
		for (int i = 0; i < 2; i++){
			cin >> str;
			if (str.size() > 80){
				cout << "overflow" << endl;
				break;
			}
			ss.clear();
			ss.str("");
			ss << str;
			ss >> num;
			sum += num;
		}
		cout << sum << endl;
		n--;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
char str[102],str1[102],ans[102];
int sam(int ma1,int ma2)
{
    int co,carry=0,a,b;
    for(int i=0;ma1-i>=0||ma2-i>=0||carry==1;i++){
            if(ma1-i>=0&&ma2-i>=0){
                    a=str[ma1-i]-'0';
                    b=str1[ma2-i]-'0';
                    if(a+b+carry>=10){
                        ans[i]=a+b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+b+carry+'0';
                        carry=0;
                    }
            }
            else if(ma1-i>=0){
                    a=str[ma1-i]-'0';
                    if(a+carry>=10){
                        ans[i]=a+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+carry+'0';
                        carry=0;
                    }
            }
            else if(ma2-i>=0){
                    b=str1[ma2-i]-'0';
                    if(b+carry>=10){
                        ans[i]=b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=b+carry+'0';
                        carry=0;
                    }
            }
            else {
                ans[i]='0'+1;
                return i;
            }
        co=i;

    }
    return co;

}
int main()
{
    int a,b,n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>str>>str1;
        a=strlen(str);
        b=strlen(str1);
        a=sam(a,b);
        if(a>80)cout<<"overflow"<<endl;
        else {
                for(int j=a;j>0;j--)cout<<ans[j];
        cout<<endl;
        }
    }

}

C++: #include<iostream>

using namespace std;

#define DATA_MAX 100

int get_length( char str[] );
void initialize_str( char str[] , int size_of_str );
int myatoi( char s );
char myitoa( int s );


int main(void)
{
	char a[DATA_MAX];
	char b[DATA_MAX];
	char ans[DATA_MAX];

	int n;

	cin >> n;

	int size_of_str_a = sizeof(a)/sizeof(a[0]);
	int size_of_str_b = sizeof(b)/sizeof(b[0]);
	int size_of_str_ans = sizeof(ans)/sizeof(ans[0]);

	for( int i = 0 ; i < n ; i++ )
	{
		initialize_str(a , size_of_str_a);
		initialize_str(b , size_of_str_b);
		initialize_str(ans , size_of_str_ans);

		cin >> a >> b;
		int length_a = get_length( a );
		int length_b = get_length( b );
		if( length_a >= 81 || length_b >= 81 ){
			cout << "overflow" << endl;
			continue;
		}
		if( length_a > length_b ){
			while(1){
				for( int j = length_a ; j > 0 ; j-- )
				{
					b[j] = b[j-1];
				}
				b[0] = '0';
				if( b[length_a] == '\0' ) break;
			}
		}
		if( length_b > length_a ){
			while(1){
				for( int j = length_b ; j > 0 ; j-- )
				{
					a[j] = a[j-1];
				}
				a[0] = '0';
				if( a[length_b] == '\0' ) break;
			}
		}
		int length_ans = ( length_a > length_b ? length_a : length_b ) + 1;

		ans[length_ans] = '\0';
		int c[2] = {0};

		for( int j = length_ans-1 ; j >= 1 ; j-- )
		{
			int add = myatoi(a[j-1]) + myatoi(b[j-1]) + c[1];
			c[0] = add%10;
			ans[j] = myitoa(c[0]);
			c[1] = add/10;
		}
		ans[0] = myitoa(c[1]);
		
		if( ans[0] == '0' ){
			for( int i = 0 ; i <= length_ans - 1 ; i++ )
			{
				ans[i] = ans[i+1];
			}
		}
		if( get_length(ans) >= 81 ){
			cout << "overflow" << endl;
		}
		else{
			cout << ans << endl;
		}
	}
}

int get_length( char str[] )
{
	int i;

	for( i = 0 ; str[i] != '\0' ; i++ )
	{
		;
	}

	return i;
}

void initialize_str( char str[] , int size_of_str )
{
	for( int i = 0 ; i < size_of_str ; i++ )
	{
		str[i] = '0';
	}

	return;
}

int myatoi( char s )
{
	return s-48;
}
char myitoa( int s )
{
	return s+48;
}