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>
     
    class BigInteger {
    	// use 18 digit a element
    	std::vector<uint64_t> splited_num_;
    public:
    	BigInteger(std::string str) {
    		set_data(str);
    	}
    	BigInteger(std::vector<uint64_t>&& splited_num) {
    		splited_num_ = std::move(splited_num);
    	}
    	BigInteger operator+(const BigInteger& rhs) {
    		return BigInteger(plus(splited_num_, rhs.get_data()));
    	}
    	std::vector<uint64_t> get_data() const {return splited_num_;}
    	std::string to_string() const {
    		std::string ret;
    		const int size = splited_num_.size();
    		for (int i = 0; i < size; ++i) {
    			const int& n = splited_num_[size - i - 1];
    			ret += n == 0 ? "000000000000000000" : std::to_string(n);
    		}
    		return ret;
    	}
    private:
    	void set_data(const std::string& str) {
    		std::string sub;
    		int length = str.length();
    		while (length >= 18) {
    			int pos = length - 18;
    			sub = str.substr(pos, 18);
    			splited_num_.push_back(to_uint64(sub));
    			length -= 18;
    		}
    		if (length > 0) {
    			sub = str.substr(0, length);
    			splited_num_.push_back(to_uint64(sub));
    		}
		}
    	std::vector<uint64_t> plus(std::vector<uint64_t> lhs,
    						       std::vector<uint64_t> rhs) const {
    		std::vector<uint64_t> ret;
     		uint64_t carry = 0;
     		
     		const int max = std::max(lhs.size(), rhs.size());
     		const int min = std::min(lhs.size(), rhs.size());
     		// ensure that lhs.sizs() is larger than rhs.size()
     		if (lhs.size() < rhs.size()) {
     			std::swap(lhs, rhs);
     		}
     		// fit container size
     		for (int i = 0; i < (max - min); ++i) {
     			rhs.push_back(0);
     		}
     		
     		for (int i = 0; i < max; ++i) {
     			uint64_t sum = lhs.at(i) + rhs.at(i) + carry;
     			carry = sum / 1000000000000000000;
     			sum = sum % 1000000000000000000;
     			ret.push_back(sum);
     		}
     		if (carry > 0) {
     			ret.push_back(carry);
     		}
     		return ret;
    	}
    	uint64_t to_uint64(const std::string& str) const {
    		std::istringstream iss(str);
    		uint64_t ret = 0;
    		iss >> ret;
    		return ret;
    	}
    };
     
    int main() {
    	std::vector<BigInteger> ans_list;
    	int n;
    	std::cin >> n;
    	for (int i = 0; i < n; ++i) {
    		std::string str1, str2;
    		std::cin >> str1;
    		std::cin >> str2;
    		BigInteger bi1(str1);
    		BigInteger bi2(str2);
    		ans_list.push_back(bi1 + bi2);
    	}
    	
    	for (auto ans : ans_list) {
    		std::cout << ans.to_string() << std::endl;
    	}
    }

C++: #include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
int main(){
    char a[1000],b[1000];
    int c[90];
    int i,j,k,l,m,n;
    scanf("%d",&n);
    // printf("%d\n",n);
    for(i=0; i<n; i++){
        for(j=0; j<90; j++){
            a[j]='0';
            b[j]='0';
            c[j]=0;
        }
        // scanf("%s",a);
        // scanf("%s",b);
        string s;
        cin>>s;
        for(int i=0;i<s.size();i++){
            a[i]=s[i];
        }
        a[s.size()]='\0';
        cin>>s;
        for(int i=0;i<s.size();i++){
            b[i]=s[i];
        }
        b[s.size()]='\0';
        // printf("%s\n",a);
        // printf("%s\n",b);
        for(j=0; j<90; j++){
            if(a[j]=='\0'){
                a[j]='0';
                break;
            }
        }
        for(k=0; k<90; k++){
            if(b[k]=='\0'){
                b[k]='0';
                break;
            }
        }
        if(j>k)l=j;
        else l=k;
        for(m=l; m>0; m--){
         if(j-1>=0)c[m]+=a[j-1]-'0';
         if(k-1>=0)c[m]+=b[k-1]-'0';
         if(c[m]>=10){
             c[m]-=10;
             c[m-1]+=1;
         }
         j--;
         k--;
        }
        if(l>=80&&c[0]!=0)printf("overflow\n");
        else {
            if(c[0]!=0)printf("%d",c[0]);
            for(j=1; j<=l; j++)printf("%d",c[j]);
            printf("\n");
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string a,b,out,tmp;
    cin >> a;
    cin >> b;
    //int m=max(a.size(),b.size());
    if(a.size()<b.size()){
      tmp=a;
      a=b;
      b=tmp;
    }
    //cout << a << endl;
    int si=-a.size()+b.size();
    for(int j=a.size()-1;j>=0;j--){
      if(j+si>=0){
	//cout << si << endl;
	a[j]+=b[j+si]-'0';
	//cout << a[j] << endl;
      }else{
	a[j]+=0;
	//cout << "!" << endl;
      }
      if(a[j]>'9'&&j!=0){
	a[j-1]++;
	a[j]-=10;
      }else if(a[j]>'9'&&j==0){
	a='1'+a;
	a[1]-=10;
	//for(int i=a.size();i>0;i--)
	//  a[i]=a[i-1];
	//a[1]-=10;
	//a[0]='1';
      }
    }
    if(a.size()>80)
      cout << "overflow" << endl;
    else
      cout << a << endl;
    //a='0';
  }

}