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>

using namespace std;

int main(void) {
	int sets;
	char input1[100], input2[100], out[100];
	int i1, i2, o, carry;
	int ic1, ic2;
	int i;

	cin >> sets;
	for(i=0;i<sets;i++) {
		scanf("%s", input1);
		for(i1=0;input1[i1] != '\0';i1++);
		if(i1 > 80) {
			printf("overflow\n");
		} else {
			scanf("%s", input2);
			for(i2=0;input2[i2] != '\0';i2++);
			if(i2 > 80) {
				printf("overflow\n");
			} else {
				i1--;i2--;o=0;carry=0;
				while(i1>=0 || i2>=0 || carry) {
					if(o > 80) { break; }
					if(i1>=0) { ic1 = input1[i1]-'0'; i1--; } else { ic1 = 0; }
					if(i2>=0) { ic2 = input2[i2]-'0'; i2--; } else { ic2 = 0; }
					if( ic1+ic2+carry < 10 ) { 
						out[o] = ic1+ic2+carry+'0';
						carry = 0;
					} else {
						out[o] = ic1+ic2+carry-10+'0';
						carry = 1;
					}
					o++;
				}
				if(o > 80) {
					printf("overflow\n");
				}
				else {
					for(o--;o>=0;o--) {
						printf("%c", out[o]);
					}
					printf("\n");
				}
			}
		}
	}

	return 0;
}

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 j=0 ; j<b.size() ; j++){
				a[a.size()-1-j] = a[a.size()-1-j] + b[b.size()-1-j] -'0';
				if(a[a.size()-1-j] > '9'){
					a[a.size()-1-j] -= 10;
					for(int l=0 ; l<a.size()-1 ; l++){
						a[a.size()-2-l] ++;
						if(a[a.size()-2-l] > '9'){
							if(a.size()-2-l == 0){
								a = "0" + a;
							}
							a[a.size()-2-l] -= 10;
						}else break;
					}
				}
			}
		}
		cout << a << endl;

		}

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int a_len,b_len,m_len;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		a_len=in.size();
		b_len=in2.size();
		for(int i=0;i<a_len;i++){
			a[a_len-1-i]=in[i]-'0';
		}
		for(int i=0;i<b_len;i++){
			b[b_len-1-i]=in[i]-'0';
		}
		m_len=max(a_len,b_len);
		if(m_len>80){
			cout<<"overflow"<<endl;
			continue;
		}/*
		f=0;
		for(int i=0;i<m_len+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[m_len]!=0){
			if(m_len>79){
				cout<<"overflow"<<endl;
				continue;
			}
			cout<<ans[m_len];
		}
		for(int i=0;i<m_len;i++){
			cout<<ans[m_len-1-i];
		}cout<<endl;
		
		*/
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;

void calcSum(string str1, string str2){
    int c = 0;
    string str = "";
    if (str1.size() > str2.size()){
        swap(str1, str2);
    }
    for (int i=0;i<(int)str1.size();i++){
        int sum = (str1[i] - '0') + (str2[i] - '0') + c;
        if (sum >= 10){
            str += (sum % 10) + '0';
            c = 1;
        }else{
            str += sum + '0';
            c = 0;
        }
    }
    for (int i=(int)str1.size();i<(int)str2.size();i++){
        int sum = (str2[i] - '0') + c;
        if (sum >= 10){
            str += (sum % 10) + '0';
            c = 1;
        }else{
            str += sum + '0';
            c = 0;
        }
    }
    if (c == 1)
        str += '1';
    reverse(str.begin(), str.end());
    if (str.size() > 80){
        cout << "overflow" << endl;
    }else{
        cout << str << endl;
    }
}

int main()
{
    int n;
    string str1, str2;
    
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> str1;
        cin >> str2;
        reverse(str1.begin(), str1.end());
        reverse(str2.begin(), str2.end());
        calcSum(str1, str2);
    }

    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int main() {
int N;
cin >> N;
for (; N > 0; --N) {
int a[80] = {}, b[80] = {}, sum[80] = {};
bool co = false;
string s, t;
cin >> s >> t;
for (int i = 0; i < s.length(); ++i) a[i] = (int)(s[i] - '0');
for (int i = 0; i < t.length(); ++i) b[i] = (int)(t[i] - '0');
for (int i = 0; i < 80; ++i) {
co = ((co?1:0)+a[i]+b[i]) >= 10;
sum[i] = ((co?1:0)+a[i]+b[i])%10;
}
if (co) cout << "overflow" << endl;
else {
bool fz = true;
for (int i = 79; i >= 0; --i)
if (fz && sum[i] != 0) {fz = false;}
if (!fz) cout << sum[i];
}
cout << endl;
}
return 0;
}