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 <cmath>
#include <vector>
#include <string>

using namespace std;

void arrangeDigits(string &str1, string &str2){
  // st1 > str2
  if(str1.length() <= str2.length()){
    string tmp = str1;
    str1 = str2;
    str2 = tmp;
  }

  string tmp2;
  for(int i=0;i<str1.length()-str2.length();i++){
    tmp2 += '0';
  }
  tmp2 += str2;
  str2 = tmp2;
  // cout << "str1: " << str1 << endl;
  // cout << "str2: " << str2 << endl;
}

int main(){
  int numDatasets;
  cin >> numDatasets;
  
  for(int i=0;i<numDatasets;i++){
    bool flag = false;
    string str1, str2;

    cin >> str1;
    //80????¶?????????´???
    if(str1.length() > 80){
      flag = true;
    }

    cin >> str2;
    //80????¶?????????´???
    if(str2.length() > 80){
      flag = true;
    }

    // ??????????????????
    arrangeDigits(str1, str2);
      
    //?¨????

    int c = 0;
    string res;

    // cout << str1.length() << endl;
    
    for(int i=0;i<str1.length();i++){
      int now;
      if((int)((char)str2[str2.size()-i-1]-'0') == -48){
	now = (int)(str1[str1.size()-i-1]-'0') + c;
      }
      else{
	now = (int)(str1[str1.size()-i-1]-'0') + (int)((char)str2[str2.size()-i-1]-'0') + c;
      }
      
      res = (char)(now%10 + '0') + res;
      c = now/10;
      // str1.pop_back();
      // str2.pop_back();
      // cout << "----" << endl;
      // cout << "i:" << i << endl;
      // cout << (int)(str1[str1.size()-i-1]-'0') << " + " << (int)(str2[str2.size()-i-1]-'0') << endl;
      // cout << "now:" << now << endl;
      // cout << "res:" << res << endl;
    }

    if(c>0){
      res = (char)(c-'0') + res;
    }
    
    if(flag == false){
      
      cout << res << endl;
    }else{
      cout << "overflow" << endl;
    }
    
  }
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
#define DEBUG(x) cerr << #x << ":" << x << endl;
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;++i){
        string a,b,c;
        int d=0,st;
        cin>>a>>b;
        for(int j=a.size();j<81;++j) a="0"+a;
        for(int j=b.size();j<81;++j) b="0"+b;
		// DEBUG(a);
		// DEBUG(b);
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        for(int j=0;j<80;++j){
            c+=((a[j]-'0')+(b[j]-'0')+d)%10+'0';
            d=((a[j]-'0')+(b[j]-'0')+d)/10;
        }
        if(d>0) cout<<"overflow\n";
        else{
            reverse(c.begin(), c.end());
			/*
            for(st=0;st<c.size();++st)if(c[st]!='0')break;
            cout<<((st==c.size())?"0\n":c.substr(st,c.size()-st)+"\n");
			*/
			st = 0;
			while(c[st] == '0') st++;
			for(int j = st; j < c.size(); j++)
				cout << c[j];
			cout << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef pair<double,double> P;
typedef complex<double> CP;
typedef long long ll;


int a[100],b[100],c[100];
char t;
string s;

int main(){
	int n;
	cin>>n;
	rep(i,n){
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		cin>>s;
		//cout<<s<<endl;
		//cout<<s.size()<<endl;
		if(s.size()>80){
			cout<<"overflow1\n";
			continue;
		}
		rep(j,s.size()){
			a[90-j]=s[s.size()-j-1]-'0';
			//cout<<s[s.size()-j-1]-'0';
		}
		//cout<<a[87]<<endl;
		cin>>s;
		if(s.size()>80){
			cout<<"overflow\n";
			continue;
		}
		rep(j,s.size()){
			b[90-j]=s[s.size()-j-1]-'0';
		}
		/*
		rep(j,91) cout<<a[j];
		cout<<endl;
		rep(j,91) cout<<b[j];
		cout<<endl;
		*/
		int t=0;
		for(int j=90;j>=0;j--){
			c[j]=(a[j]+b[j]+t)%10;
			if((a[j]+b[j]+t)>9) t=1;
			else t=0;
		}
		bool f=true;
		/*
		rep(j,91) cout<<c[j];
		cout<<endl;
		*/
		rep(j,91){
			if(f&&c[j]!=0){
				f=false;
				if(j<=10){
					cout<<"overflow";
					break;
				}
			}
			if(!f) cout<<c[j];
		}
		cout<<endl;
		
	}
	return 0;
}