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 <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}

		ans = to_string(added)+ans;
		/*/
		stringstream ss;
		ss << added;

		ans = ss.str() + ans;*/
		be1 = bef;
		if (i == 0)
		{
			break;
		}
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>
#include <stack>

using namespace std;

int main(){
    
    char d;
    char e;
    using namespace std;
    stack<int> st1;
    stack<int> st2;
    stack<int> st3;
    int n=0;
    //scanf("%d",&n);
    while((d=getchar())!='\n'){
        n=n*10+atof(&d);
    }
    
    for(int i=0; i<n; i++){
        
        while((d=getchar())!='\n'){
            //printf("a%c\n",d);
            st1.push(atof(&d));
        }
        
        //while(getchar()!='\n'){}
        
        while((e=getchar())!='\n'){
            //printf("b%c\n",e);
            st2.push(atof(&e));
        }
        int temp=0;
        int num=0;
        
        while(st1.empty() != true || st2.empty() != true){
            if(st1.empty()==true && st2.empty()!=true){
                temp+=st2.top();
                st2.pop();
            }else if(st1.empty()!=true && st2.empty()==true){
                temp+=st1.top();
                st1.pop();
            }else{
                temp+=st1.top()+st2.top();
                st1.pop();
                st2.pop();
            }
            st3.push(temp%10);
            temp=temp/10;
            num++;
        }
        if(temp!=0){
            st3.push(temp);
        }
        if(st3.size()>80){
            printf("overflow");
        }else{
            while(st3.empty()!=true){
                cout << st3.top();
                st3.pop();
            }
        }
        printf("\n");
        
        
        
    }
    
}

C++: #include <bits/stdc++.h>
using namespace std;

class bigint {
	deque<uint8_t> val;

public:
	bigint( const string& s ) {
		for( auto c: s ) {
			val.push_front( c - '0' );
		}
	}

	void add( const bigint& b ) {
		int x = 0;
		int i = 0;

		for( ; i < b.val.size(); ++i ) {
			if( i >= val.size() ) {
				val.push_back( 0 );
			}

			x += val[i] + b.val[i];
			val[i] = x % 10;
			x /= 10;
		}

		for( ; x > 0; ++i ) {
			if( i >= val.size() ) {
				val.push_back( 0 );
			}

			x += val[i];
			val[i] = x % 10;
			x /= 10;
		}
	}

	int length() const {
		return (int)val.size();
	}

	void print() const {
		for( int i = (int)val.size()-1; i >= 0; --i ) {
			cout << (int)val[i];
		}

		cout << '\n';
	}
};

int main() {
	ios_base::sync_with_stdio( false );

	int N;
	cin >> N;

	for( int i = 0; i<N; ++i ) {
		string a, b;
		cin >> a >> b;

		bigint x( a );
		x.add( b );

		if( x.length() <= 80 ) {
			x.print();
		}
		else {
			cout << "overflow" << '\n';
		}
	}
}

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

using namespace std;

int main(int argc, char* argv[])
{
	int i;
	int num, pos;
	int len1, len2;
	int sum[101] = { 0 };
	char temp;
	char f1[101] = { 0 }, f2[101] = { 0 };	

	cin >> num;
	while (num--) {
		cin >> f1;
		cin >> f2;

		len1 = strlen(f1);
		len2 = strlen(f2);
		if (len1 > 80 || len2 > 80) {
			cout << "overflow" << endl;
			continue;
		}

		for (int i = 0; i < len1 / 2; i++) {
			temp = f1[i];
			f1[i] = f1[len1 - 1 - i];
			f1[len1 - 1 - i] = temp;
		}
		for (int i = 0; i < len2 / 2; i++) {
			temp = f2[i];
			f2[i] = f2[len2 - 1 - i];
			f2[len2 - 1 - i] = temp;
		}

		for (i = 0; i < len1; i++) f1[i] = f1[i] - 0x30;
		for (i = 0; i < len2; i++) f2[i] = f2[i] - 0x30;

		for (int i = 0; i < 100; i++) {
			sum[i] += (f1[i] + f2[i]);
			if (sum[i] >= 10) {
				sum[i] -= 10;
				sum[i + 1]++;
			}
		}

		for (pos = 100; sum[pos] == 0; pos--) {}
		if (pos >= 80) {
			cout << "overflow" << endl;
			return 0;
		}
		for (int i = pos; i >= 0; i--) {
			cout << sum[i];
		}
		cout << endl;
	}
}