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 <vector>
#include<string>
#include<sstream>
#define CAPACITY 9
 
 
namespace stoi{//stoi??????¨??????????????????????????????????????????§???£??¨???????
 
    int stoi(std::string str){
        int ret;
        std:: stringstream ss;
        ss << str;
        ss >> ret;
        return ret;
    }
 
}
class OverDigit{
 
public:
 
    int num_a[CAPACITY];
    int num_b[CAPACITY];
    OverDigit(std::string str_a, std::string str_b);
    void ChangeDigit(std::string str,int num[]);
    void Add();
};
 
OverDigit::OverDigit(std::string str_a,std::string str_b){
 
    ChangeDigit(str_a, num_a); 
    ChangeDigit(str_b, num_b);
 
}
 
void OverDigit::ChangeDigit(std::string str, int num[]){
 
    std::vector <int> num_str(CAPACITY, 0);
    int loc = CAPACITY, k = 8;
    int str_Max, str_rest;
 
    str_Max = str.length() / CAPACITY;//
    str_rest = str.length() % CAPACITY;
 
        for (int j = str.length() - CAPACITY; str_Max > 0; j = j-CAPACITY){
        num_str[k] = stoi::stoi(str.substr(j, CAPACITY));
        loc = k;
        k--;
        str_Max--;
    }
    //?????????????????????????????????????????\??????
     
        if(str_rest!=0)num_str[loc - 1] = stoi::stoi(str.substr(0, str_rest));
 
    for (int j = 0; j < CAPACITY; j++){
    num[j]=num_str[j];
    }
}
//80?????????§?????¶???????
void OverDigit::Add(){
 
    int num_ans[CAPACITY] = {};
    int fat,overflow=0,count=0;
 
    for (int j = CAPACITY-1; j >0; j--){
        if (num_a[j] + num_b[j]<=999999999){
            num_ans[j] = num_a[j] + num_b[j];
        }
        else if (num_a[j] + num_b[j] > 999999999){
            fat = (num_a[j] + num_b[j]) - 1000000000;
            num_ans[j] = fat;
            num_a[j - 1]++;     
        }
 
    }
 
     if (num_a[0] + num_b[0] > 99999999){
        overflow = 1;
     }
     else{
         num_ans[0]= num_a[0] + num_b[0];
          
 
     }
 
    if (overflow == 1){
        std::cout << "overflow" << std::endl;
    }
    else {
        for (int j = 0; j < CAPACITY; j++){
            if (num_ans[j] != 0){
                count++;
                std::cout << num_ans[j];
 
            }
            else if (num_ans[j] == 0 && count >= 1){
                std::cout << "000000000";
            }
 
        }std::cout << std::endl;
    }
 
};
 
 
int main(){
     
 
    //vector????????????¨??????80????????¨????
    int N;
    std::string str_a, str_b;
 
    std::cin >> N;
    std::cin.ignore();
 
    for (int i = 0; i < N; i++){
        getline(std::cin, str_a);
        getline(std::cin, str_b);
        OverDigit OverDigit_a(str_a,str_b);//????????????§??????
        OverDigit_a.Add();
    }
 
    return 0;
}

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

int main()
{
int x,h;
double a,b;
cin>>x;
for(int i=0; i<x; i++)
{
 while(true)
 {
  cin>>a>>b;
  if(a.size()>=80||b.size()>=80) break;
  else
  {
   cout<<a+b<<endl;
  }
 }
}
return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
class Longint{
  vector<long long> V;
public:
  Longint(string s);
  int size();
  void print();
  Longint operator+(const Longint &o);
  Longint operator+=(const Longint &o);
};

int Longint::size(){
  return (this->V.size()-1)*9+to_string(V.back()).size();
}

void Longint::print(){
  printf("%lld",this->V.back());
  for (int i=this->V.size()-2;i>=0;i--){
    printf("%09lld",this->V[i]);
  }
}

Longint Longint::operator+(const Longint &o){
  Longint R("");
  const long long MOD = 1000000000;
  int i,k = max(this->V.size(),o.V.size());
  for(i=0;i<k;i++){
    R.V.push_back(0);
    if(i<this->V.size()){
      R.V.back() += this->V[i];
    }
    if(i<o.V.size()){
      R.V.back() += o.V[i];
    }
  }
  for(i=0;i<k-1;i++){
    R.V[i+1] += R.V[i]/MOD;
    R.V[i] %= MOD;
  }
  if(R.V[k-1]>=MOD){
    R.V.push_back(R.V[k-1]/MOD);
    R.V[k-1]%=MOD;
  }
  return R;
}

Longint Longint::operator+=(const Longint &o){
  return *this = *this+o;
}

Longint::Longint(string s){
  int n=s.size(),i,j = 0;
  long long d,h[9] = {1,10,100,1000,10000,100000,1000000,10000000,100000000};
  for (i=n-1;i>=0;i--){
    d=s[i]-'0';
    if(j == 0){
      this->V.push_back(d);
    }
    else{
      this->V.back() += d*h[j];
    }
    j = (j+1)%9;
  }
}

int main(){
  int t,i;cin >> t;
  string a,b;
  for(i=0;i<t;i++){
    cin >> a >> b;
    Longint G(a),H(b);
    G += H;
    if(G.size() > 80) printf("overflow");
    else G.print();
    printf("\n");
  }
}