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 <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;
    //scanf("%d",&n);
    while((d=getchar())!='\n'){
        n=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 <algorithm>
#include <iostream>
using namespace std;
string add(string a,string b){
	string res;
	int sa=a.size(),sb=b.size(),va,vb,t=0;
	for(int i=1;i<=max(sa,sb);i++){
		if(sa-i<0)va=0;else va=a[sa-i]-'0';
		if(sb-i<0)vb=0;else vb=b[sb-i]-'0';
		if(t)va++;
		t=((va+vb)>9);res=(char)(va+vb-t*10+'0')+res;
	}
	if(t)res="1"+res;
	return res;
}
int main() {
	string a,b;
	int n;
	for(cin>>n;n--;){
		cin>>a>>b;
		a=add(a,b);
		if(a.size()>80){
			cout<<"overflow"<<endl;
		}else{
			cout<<a<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
void sum (string &sum, string& a, string& b);

int main(){
  string a1, a2;
  int n, A1, A2;

  cin >> n;
  for(int i = 0; i < n ; i++){
    string sum0 = "";
    cin >> a1 >> a2;
    reverse(a1.begin(), a1.end());
    reverse(a2.begin(), a2.end());
    A1 = a1.length();
    A2 = a2.length();
    if(A1 < A2) {
      swap (A1, A2);
      swap (a1, a2);
    }

    for(int i = 0; i < A1 - A2; i++)   a2 += '0';

    sum(sum0, a1, a2);

    if (sum0.length() > 80) sum0 = "overflow";
    else  reverse(sum0.begin(), sum0.end());
    
    cout << sum0 << endl;
  }
}

void sum(string& buff, string& a, string& b){
  //string buff = "";
  int x = 0, y ;
  for(int i = 0; i < a.length(); i++){
    y = a[i] - '0' + b[i] - '0';
    if (y + x > 9){
      buff += (y + x)% 10 + '0';
      x = 1;
    } else {
      buff += y + x + '0';
      x = 0;
    }
  }
  if (x==1) buff += '1';
  //return &buff;
}

C++: 
#include <cmath>
#include <iostream>
#include <cstdio>
#include <ctype.h>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <iomanip>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <sstream>


using namespace std;


string reverse(string str)
{
	string ret = "";
	
	for (int i=str.length()-1; i>=0; i--)
	{
		ret += str[i];
	}
	
	return ret;
}


/*
指定したインデックスの文字を数値に直して返す関数。
インデックスが不正な場合は数値0を返す。
*/
int new_at(string str, int index)
{
	stringstream ss;
	int ret;
	
	if (index >= str.length())
	{
		return 0;
	} else {
		ss << str[index];
		ss >> ret;
		
		return ret;
	}
}


int main()
{
	int n;
	int ia, ib;
	int flag = 0;	//繰り上がりのフラグ(繰り上がる場合は1)
	int num = 0;	//各桁の和
	
	string sa, sb;	//入力値
	string ra, rb;	//反転した入力値
	
	string sum = "";
	stringstream ss;
	int cnt;	//長いほうの文字数
	
	
	cin >> n;
	for (int i=0; i<n; i++)
	{
		cin >> sa >> sb;
		ra = reverse(sa);
		rb = reverse(sb);
		//cout << "ra = " << ra << " : rb = " << rb << endl;
		
		cnt = (ra.length() > rb.length()) ? ra.length() : sb.length();
		//cout << "cnt = " << cnt << endl;
		
		for (int j=0; j<cnt; j++)
		{
			num += new_at(ra, j) + new_at(rb, j);
			if (flag) num++;
			//cout << "(j=" << j << ") : num = " << num << endl;
			
			if (num >= 10)
			{
				num = num - 10;
				ss << num;
				sum += ss.str();
				num = 0;
				flag = 1;
			} else {
				ss << num;
				sum += ss.str();
				num = 0;
				flag = 0;
			}
			
			ss.str("");
			
			//cout << "(j=" << j << ") : sum = " << sum << endl;
		}
		
		if (flag)
		{
			sum += "1";
			flag = 0;
		}
		
		if (sum.length() > 80)
		{
			cout << "overflow" << endl;
		} else {
			//cout << "sum = " << reverse(sum) << endl;
			cout << reverse(sum) << endl;
		}
		
		sum = "";
		num = 0;
		//cout << "new_at = " << new_at(sa, 3) << endl;
		//cout << "sa = " << reverse(sa) << " : sb = " << reverse(sb) << endl;
		//cout << "sa[0] = " << sa[0] << " : sb[0] = " << sb[0] << endl;
	}
	
	return 0;
}