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;

//?????????10?????????????????????
vector<string> splitstring(string str, int n){
  vector<string> tmp;
  for(int i=str.length();i>0;i-=n){
    // cout << "i: " << i << ", i-n:" << i-n << ", i-1:" << i-1 << " ";
    if(i-n > 0){
      cout << "str.substr: " << str.substr(i-n, n) << endl;
      tmp.push_back(str.substr(i-n, n));
    }
    else{
      cout << "str.substr: " << str.substr(0, i) << endl;
      tmp.push_back(str.substr(0, i));
    }
  }
  
  // for(int i=0;i<str.length();i+=n){
    // cout << "str.substr: " << str.substr(i, n) << endl;
    // tmp.push_back(str.substr(i, n));
  // }

  return tmp;
}


int main(){
  int numDatasets;
  cin >> numDatasets;

  for(int i=0;i<numDatasets;i++){
    vector<string> splittedStr1, splittedStr2;
    vector<int> splittedInt1, splittedInt2;
    string str1, str2;
    cin >> str1;
    
    splittedStr1 = splitstring(str1, 7);
    for(int i=0;i<splittedStr1.size();i++){
      splittedInt1.push_back(std::stoi(splittedStr1[i]));
      // cout << splittedInt1[i] << endl;
    }

    cin >> str2;

    splittedStr2 = splitstring(str2, 7);
    for(int i=0;i<splittedStr2.size();i++){
      splittedInt2.push_back(std::stoi(splittedStr2[i]));
      // cout << splittedInt2[i] << endl;
    }

    vector<int> calced(max(splittedInt1.size(), splittedInt2.size()), 0);
    
    for(int i=0;i<calced.size();i++){
      if(i < splittedInt1.size()){
	calced[i] += splittedInt1[i];
      }
      if(i < splittedInt2.size()){
	calced[i] += splittedInt2[i];
      }
    }

    //debug
    for(int i=0;i<calced.size();i++){
      // cout << i << ": " <<  calced[i] << endl;
    }

    // cout << "---" << endl;

    
    //??°???????????????
    vector<int> calcedRes(calced.size()+1, 0);
    for(int i=0;i<calced.size();i++){
      int tmp = (calced[i]+calcedRes[i])/(int)pow(10.0, 7);
      calcedRes[i] = (calced[i]+calcedRes[i]) - tmp*pow(10.0, 7);
      calcedRes[i+1] = tmp;
      // cout << "calcedRes[" << i  << "]: " << calcedRes[i] << ", tmp: " << tmp << endl;
    }
      
      
      
      // calcedRes[calced.size()-i-2] += tmp;
      // calced[calced.size()-i-1] -= tmp*pow(10.0, 7);

      // int tmp = calced[i-1]/(int)pow(10.0, 7);
      // calced[i-1] -= tmp;
      // calced[i] += tmp; 

    // cout << "---" << endl;

    //int to str;
    string res = "";
    for(int i=calcedRes.size()-1;i>-1;i--){
      string str = to_string(calcedRes[i]);
      // cout << i << ":" << str << endl;
      if(i==calcedRes.size()-1){
	
	if(calcedRes[i]==0){
	  continue;
	}
      }

      while(str.length()<7){
	if(i==calcedRes.size()-1 || i==calcedRes.size()-2){
	  break;
	}
	str += "0";
      }


      
      res += str;
    }

    // cout << "result: " << res << endl;
    cout << res << endl;
  }
}

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

int main() {
  int tcase;
  
  cin >> tcase;
  while(tcase--) {
    string A, B, C = "";
    cin >> A >> B;
    
    unsigned sz = max(A.size(), B.size());
    while(A.size()<sz) A = '0' + A;
    while(B.size()<sz) B = '0' + B;

    int c = 0;
    for(int i=sz-1; i>=0; i--) {
      // 確定情報
      C += (( (A[i]-'0') + (B[i]-'0') + c ) % 10 + '0');
      // 前座
      c = ( (A[i]-'0') + (B[i]-'0') + c ) / 10;
    }
    if(c>0) C += (c + '0');
    
    reverse(C.begin(), C.end());
    if(C.size() > 80) cout << "overflow" << endl;
    else cout << C << endl;
  }
  return 0;
}

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

int main(){
  std::string str1,str2,sumstr;
  while(std::cin>>str1>>str2){
    sumstr.clear();
    std::reverse(str1.begin(),str1.end());
    std::reverse(str2.begin(),str2.end());
    unsigned size=std::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;
    }
    std::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');
    std::reverse(sumstr.begin(),sumstr.end());
    sumstr.push_back('\0');
    if(sumstr.size()<=80)
      std::cout<<sumstr<<std::endl;
    else
      std::cout<<"overflow"<<std::endl;
  }
}