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 <boost/multiprecision/cpp_int.hpp>

using namespace boost::multiprecision;

int main()
{
  unsigned int a;
  cpp_int b, c;
  std::cin >> a;
  for (unsigned int i = 0; i < a * 2; ++i) {
    if (i % 2 == 0) {
      std::cin >> b;
    } else {
      std::cin >> c;
      std::cout << b + c << std::endl;
    }
  }
}

C++: #include<iostream>
#include<string>
#include<sstream>
#include<iomanip>
using namespace std;
class BigInt{
  unsigned int i[11];
public:
  BigInt(string str){
    i[0]=0;
    for(int j=80;j>0;j-=8){
      if((int)str.size()>j){
	stringstream ss;
	ss << str.substr(str.size()-j,8);
	ss >> i[11-j/8];
      }else if((int)str.size()+8>j){
	stringstream ss;
	ss << str.substr(0,str.size()+8-j);
	ss >> i[11-j/8];
      }else{
	i[11-j/8]=0;
      }
    }
  }
  BigInt():i{0,0,0,0,0,0,0,0,0,0,0}
  {}
  void print(){
    if(i[0])
      cout << "overflow\n";
    else{
      int j=1;
      for(;j<11;j++)
	if(i[j]>0)
	  break;
      cout << i[j++];
      for(;j<11;j++)
	cout << setfill('0') << setw(8) << right << i[j];
      cout << "\n";
    }
  }
  BigInt operator+(const BigInt& rhs){
    BigInt result = rhs;
    for(int j=10;j>0;j--){
      result.i[j] += i[j];
      if(result.i[j]>=100000000){
	result.i[j]-=100000000;
	result.i[j-1]++;
      }
    }
    return result;
  }
};

int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string tmp;
    cin>>tmp;
    BigInt b(tmp);
    cin>>tmp;
    BigInt a(tmp);
    (a+b).print();
  }
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >>n;
  cin.ignore();
  while(n--){
    string one;
    string two;
    string ans[100];
    getline(cin,one);
    getline(cin,two);
    int os = one.size()-1, ts = two.size()-1;
    int ls = max(os,ts), ss = min(os,ts);
    int as = 0,x,t = 0;
    for(int i=0; i<=ls; i++){
      if(i<=os && i<=ts){x = one[os-i]+two[ts-i]-'0'*2+t;}
      else if(i<=os){x = one[os-i]-'0'+t;}
      else if(i<=ts){x = two[ts-i]-'0'+t;}
      t = x/10;
      x = x%10;
      ans[i] = x+'0';
      as++;
    }
    if(t>0){ans[as+1] = t+'0';as++;}
    if(as>=80){cout <<"overflow"<<endl;}
    else{
      for(int i=as; i>=0; i--){
	cout <<ans[i];
      }
      cout <<endl;
    }
  }
  return 0;
}

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

using namespace std;

void sum80(int* a, int* b);
int get80(string str, int* num);

int main(void){
	string a80, b80;
	int a[81], b[81], s[81];
	char c;
	int i, N;
	cin>>N;
	i=0;
	while(i<N){
		cin>>a80;
		cin>>b80;
		if(get80(a80, a)<0 || get80(b80, b)<0){
			cout<<"overflow"<<endl;
		}else{
			sum80(a, b);
		}
		i++;
	}
	return 0;
}

int get80(string str, int* num){
	char c;
	int k;
	int d=str.length();
	if(d<=80){
		for(int i=0; i<d; i++){
			num[i]=str[d-1-i]-'0';
		}
		for(int i=d;i<81; i++){
			num[i]=0;
		}
		return d;
	}else{
		return -1;
	}

}

void sum80(int* a, int* b){
	int s[81], amari;
	amari=0;
	for(int i=0; i<81; i++){
		if(a[i]+b[i]>=10){
			amari=1;
		}else{
			amari=0;
		}
		s[i]=(a[i]+b[i]+amari)%10;
	}
	if(s[80]!=0){
		cout<<"overflow"<<endl;
	}else{
		bool flag=false;
		for(int i=79; i>=0; i--){
			if(flag || s[i]!=0){
				flag=true;
				cout<<s[i];
			}
		}
		cout<<endl;
	}
}

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


int main(){
  int n,i,j;
  string a,b;
  int sum[110]={};
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    int flag=0;
    if(sa>=80||sb>=80) flag =1;
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
    }
    sum[max(sa,sb)]=up;
    int k=110-1;
    while(sum[k]==0&&k>0) k--;
    if(k>=80||flag==1) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << '\0' << endl;
  }
}