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"); }
		scanf("%s", input2);
		for(i2=0;input2[i2] != '\0';i2++);
		if(i2 > 80) { printf("overflow\n"); }
		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<string>;
using namespace std;
string Sum(string str1, string str2){
	int str1_index, str2_index, num, advance;
	string strsum;
	if(str1.size() < str2.size()){
		while(str1.size() != str2.size()) str1 = "0" + str1;
	}else if(str1.size() > str2.size()){
		while(str1.size() != str2.size()) str2 = "0" + str2;
	}
	str1_index = str1.size()-1;
	str2_index = str2.size()-1;
	advance = 0;
	while(true){
		num = (str1[str1_index] - '0') + (str2[str2_index] - '0') + advance;//????????????????£?????¶???????+??°????????°
		strsum = char( (num % 10) + '0') + strsum;//??????????????\
		//cout<<"strsum="<<strsum<<endl;
		(num >= 10)? advance=1: advance=0;
		str1_index--;
		str2_index--;
		if(str1_index<0 || str2_index<0){
			if(advance>0) strsum = "1" + strsum;
			break;
		}
	}
	return strsum;
}

int main(){
	int i, n;
	string str1,str2;
	string strsum;
	while(cin>>n){
		for(i=0;i<n;i++){
			cin>>str1;
			if(str1.size()>80) cout<<"overflow"<<endl;
			cin>>str2;
			if(str2.size()>80) cout<<"overflow"<<endl;
			strsum = Sum(str1, str2);
			if(strsum.size()>80)
				cout<<"overflow"<<endl;
			else
				cout<<strsum<<endl;
		}
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
double EPS=1e-10;
int INF=1e9;
string sum(string a,string b){
      string res="";
      reverse(ALL(a));
      reverse(ALL(b));
      if(a.size()>b.size())swap(a,b);
      int k=0;
      REP(i,a.size()){
            int t=a[i]-'0'+b[i]-'0'+k;
            res+=(char)(t%10+'0');
            k=t/10;
      }
      for(int i=a.size();i<b.size();i++){
            int t=b[i]-'0'+k;
            res+=(char)(t%10+'0');
            k=t/10;
      }
      while(k>0){
            res+=(char)(k%10+'0');
            k/=10;
      }
      reverse(ALL(res));
      return res;
}
int main(){
      int n;
      cin>>n;
      while(n--){
            string a,b;
            cin>>a>>b;
            string ans=sum(a,b);
            if(ans.size()>80){
                  cout<<"overflow"<<endl;
            }else{
                  cout<<ans<<endl;
            }
      }
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<iomanip>
#include<functional>
using namespace std;
typedef long long llong;
int main() {
	int n; cin >> n;
	while (n--) {
		string big, small;
		cin >> big >> small;
		if (small.size() > big.size())swap(big, small);
		reverse(big.begin(), big.end());
		reverse(small.begin(), small.end());
		//cout << "reverse" << endl << s1 << endl << s2 << endl;
		vector<int>vb(big.size()), vs(small.size());
		for (int i = 0; i < big.size(); i++)vb[i] = big[i] - '0';
		for (int i = 0; i < small.size(); i++)vs[i] = small[i] - '0';
		for (int i = 0; i < small.size(); i++) vb[i] += vs[i];
		for (int i = 0; i < big.size(); i++) {
			if (vb[i] >= 10) {
				vb[i] -= 10;
				if (i == big.size() - 1)vb.push_back(1);
				else vb[i + 1]++;
			}
		}
		if (vb.size() > 80)cout << "overflow" ;
		else for (int i = 0; i < vb.size(); i++) {
			cout << vb[vb.size() - 1 - i];
		}
		cout << endl;
	}
	return 0;
}