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

using namespace std;


int main(){

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

		if(b.size() > a.size()){
			string temp;
			temp = a;
			a = b;
			b = temp;
		}

		if(a.size() > 80){
			cout << "overflow" << endl;
		}else{
			for(int i=0 ; i<b.size() ; i++){
				a[a.size()-1-i] += b[b.size()-1-i] - '0';
				if(a[a.size()-1-i] > '9'){
					a[a.size()-1-i] -= 10;
					if((a.size()-1-i)==0){
						a = "1" + a;
						break;
					}
					
					for(int j=i ; a.size()-2-j >= 0 ; j++){
						a[a.size()-2-j]++;
						if(a[a.size()-2-j] > '9'){
							a[a.size()-2-j] -= 10;
							if((a.size()-2-j) == 0){
								a = "1" + a;
								break;
							}
						}else break;
					}
				}
			}
		}
		if(a.size() > 80){
			cout << "overflow" << endl;
		}else{
			cout << a << endl;
		}
		

	}

	return 0;
}

C++: /*
	0015:National Budget
*/
#include	<iostream>
#include	<string>
#include	<iterator>

using namespace std;

int main(void) {
	int n;
	
	cin >> n;
	for(int i = 0; i < n; i++) {
		string num1, num2, result;
		bool isMoveUp = false;
		
		cin >> num1;
		if(num1.size() > 80) {  cout << "overflou" << endl; continue;  }
		cin >> num2;
		if(num2.size() > 80) {  cout << "overflou" << endl; continue;  }
		string::reverse_iterator st1 = num1.rbegin();
		string::reverse_iterator st2 = num2.rbegin();
		while( st1 != num1.rend() || st2 != num2.rend()) {
			char buf1 = st1 != num1.rend() ? (*st1) : '0';
			char buf2 = st2 != num2.rend() ? (*st2) : '0';
			int buf3 = (buf1 - '0') + (buf2 - '0');
			
			isMoveUp = false;
			if(buf3 >= 10) {
				isMoveUp = true;
				(*(st1+1))++; buf3 -= 10;
			}
			result += (buf3 + '0');
			if(st1 != num1.rend()) { st1++; }
			if(st2 != num2.rend()) { st2++; }
		}
		if(isMoveUp) { result += '1'; }
		if(result.size() > 80) { cout << "overflou" << endl; continue; }
		string::reverse_iterator rt = result.rbegin();
		while(rt != result.rend()) {
			cout << (*rt);
			rt++;
		}
		cout << endl;
	}
	return 0;
}

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

char s1[100];
char s2[100];

int n1[100];
int n2[100];

int no[100];
char so[100];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i = 0; i < n; i++)
	{
		scanf("%s",s1);
		scanf("%s",s2);
		int l = strlen(s1);
		for(int i = 0; i < l; i++)
		{
			n1[i] = s1[l - 1 - i] - '0';
		}
		for(int i = l; i < 80; i++)
		{
			n1[i] = 0;
		}
		l = strlen(s2);
		for(int i = 0; i < l; i++)
		{
			n2[i] = s2[l - 1 - i] - '0';
		}
		for(int i = l; i < 80; i++)
		{
			n2[i] = 0;
		}
		int keta = 0;
		for(int i = 0; i < 80; i++)
		{
			int w = n1[i] + n2[i] + keta;
			no[i] = w % 10;
			keta = w / 10;
		}
		if(keta != 0)
		{
			printf("overflow\n");
		}
		else
		{
			int b = 0;
			for(int i = 80 - 1; i >= 0; i--)
			{
				if(b != 0 || no[i] != 0)
				{
					so[b] = no[i] + '0';
					b++;
				}
			}
			so[b] = '\0';
			printf("%s\n",so);
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <string>
#include <complex>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)

typedef vector<int> vi;

int n;
string s1, s2;
char n1[81], n2[81], sum[81];

int main() {
	scanf("%d", &n);
	rep(i,n) {
		memset(n1, 0, sizeof(n1));
		memset(n2, 0, sizeof(n2));
		memset(sum, 0, sizeof(sum));

		cin>>s1>>s2;
		int l1 = s1.size();
		int l2 = s2.size();
		if(max(l1,l2) > 80) {
			printf("overflow\n");
			return 0;
		}

		rep(k,l1) n1[k] = s1[l1-k-1] - '0';
		rep(k,l2) n2[k] = s2[l2-k-1] - '0';

		char a = 0;
		rep(i,80) {
			char c = n1[i] + n2[i] + a;
			a = c / 10;
			sum[i] = c % 10;
		}

		if(sum[80] != 0) {
			printf("overflow\n");
			return 0;
		}

		bool start = false;
		repd(i,80,0) {
			if(sum[i] != 0) start = true;
			if(!start && sum[i] == 0) continue;
			printf("%d", sum[i]);
		}
		if(!start) printf("0");
		printf("\n");
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>

using namespace std;

string sum(string& a, string& b){
	int i = a.length() - 1;
	int j = b.length() - 1;
	int carry = 0;
	string temp;

	while(i >= 0 || j >= 0){
		int c = i >= 0 ? a[i] - '0' : 0;
		int d = j >= 0 ? b[j] - '0' : 0;

		temp.push_back((c + d + carry) % 10 + '0');
		carry = (c+d) / 10;
		--i, --j;
	}

	if(carry)
		temp.push_back('1');

	reverse(begin(temp), end(temp));

	return temp;
}

int main(){
	int n;
	cin >> n;

	vector<string> input(n*2);

	for(int i = 0; i < n*2; i++){
		cin >> input[i];
	}

	for(int i = 0; i < n; i++){
		string t = sum(input[2*i], input[2*i+1]);
		if(t.size() <= 80)
			cout << t << endl;
		else
			cout << "overflow" << endl;
	}

	return 0;
}