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 <cstring>
#include <algorithm>

const int MAX_SIZE = 128;

#define toI(x) (x-'0')

using namespace std;

class Z
{
private:
  int size;
  char d[MAX_SIZE];
public:
  Z(char *s)
  {
    size = strlen(s);
    for(int i=0;i<MAX_SIZE - size;i++)
      d[i] = -1;
    for(int i=0,j=MAX_SIZE - size;j < MAX_SIZE; i++, j++)
      d[j] = s[i];
  }

  void add(Z r)
  {
    int tmp = max(this->size, r.size);
    int updigit = 0;
    for(int i=MAX_SIZE-1;i>=0;i--){
      int a = 0, b = 0;
      if(this->d[i] == -1 && r.d[i] == -1){
	if(!updigit)
	  continue;
	this->d[i] = updigit+'0';
	updigit = 0;
	tmp++;
      }else{
	if(this->d[i] != -1)
	  a = toI(this->d[i]);
	if(r.d[i] != -1)
	  b = toI(r.d[i]);
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
    this->size = tmp;
    return;
  }

  void print()
  {
    if(this->size > 80){
      puts("overflow");
      return;
    }
    for(int i=0;i<MAX_SIZE;i++)
      if(d[i] != -1)
	putchar(d[i]);
    puts("");
  }

  int sz()
  {
    return this->size;
  }
};

int main()
{
  int d;
  scanf("%d", &d);
  while(d--){
    char s1[128], s2[128];
    scanf("%s",s1);
    scanf("%s",s2);
    Z z1(s1);
    Z z2(s2);
    if(z1.sz() > 80 || z2.sz() > 80){
      puts("overflow");
      continue;
    }
    z1.add(z2);
    z1.print();
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string>
#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();
		m_len=max(a_len,b_len);
		
	}
	
	
	return 0;
}

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

string plus(string,string);
void turn(string &);
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i){
		string str,sts;
		cin>>str>>sts;
		cout<<plus(str,sts)<<endl;
	}
	return 0;
}

string plus(string str,string sts){
	turn(str);
	turn(sts);
	while(str.size()!=sts.size()){
		if(str.size()<sts.size()){
			str+='0';
		}else{
			sts+='0';
		}
	}
	str+='0';
	sts+='0';
	for(int i=0;i<str.size()-1;++i){
		str[i]+=sts[i]-'0';
		while(str[i]>'9'){
			++str[i+1];
			str[i]-=10;
		}
	}
	if(str.back()=='0'){
		str.pop_back();
	}
	if(str.size()>80){
		return "overflow";
	}
	turn(str);
	return str;
}

void turn(string &str){
	for(int i=0;i<str.size()/2;++i){
		swap(str[i],str[str.size()-i-1]);
	}
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>
#include <cstdlib>
#include <typeinfo>
using namespace std;



int main(){
	int n;
	string x, y;
	int a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x >> y;
		if (x.length() > 80 || y.length() > 80)
		{
			cout << "overflow" << endl;
		}
		else
		{
			a = stoi(x);
			b = stoi(y);
			if (to_string(a + b).length() > 80)
			{
				cout << "overflow" << endl;
			}
			else cout << a + b << endl;
		}
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
#define ALL(v) v.begin(),v.end()
string calc(string a,string b){
	reverse(ALL(a));
	reverse(ALL(b));
	while(a.size() < b.size())a += '0';
	while(b.size() < a.size())b += '0';
	int c=0;
	string res;
	for(int i=0;i<a.size();i++){
		c = c+a[i]-'0'+b[i]-'0';
		res += c%10+'0';
		c /= 10;
	}
	if(c)res += c+'0';
	if(res.size() > 80)return "overflow";
	reverse(ALL(res));
	return res;
}
int main(){
	int n;
	string a,b;
	cin>>n;
	while(n--){
		cin>>a>>b;
		cout<<calc(a,b)<<endl;
	}
	return 0;
}

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

using namespace std;

int main(){
  string str1,str2;
  int n;

  cin>>n;
  vector<string> ans;

  while((ans.size()<n)&&cin>>str1>>str2){
    string sumstr;
    reverse(str1.begin(),str1.end());
    reverse(str2.begin(),str2.end());

    unsigned size=min(str1.size(),str2.size());
    unsigned i;
    unsigned carry=0;
    for(i=0;i<size;++i){
      unsigned sum=str1[i]+str2[i]+carry-'0'*2;
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }

    string large=(str1.size()>str2.size())?str1:str2;
    for(;i<large.size();++i){
      unsigned sum=large[i]+carry-'0';
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }

    if(carry) sumstr.push_back(carry+'0');
    reverse(sumstr.begin(),sumstr.end());
    sumstr.push_back('\0');

    if(sumstr.size()<=81)
      cout<<sumstr<<endl;
    else
      cout<<"overflow"<<endl;

  }
}