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 <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>
#include <stack>

using namespace std;

int main(){
    
    string d[100000];
    string e[100000];
    
    stack<char> st1;
    stack<char> st2;
    stack<int> st3;
    int n=0;
    scanf("%d",&n);
    for(int i=0; i<n; i++){
        cin>>d[i];
        cin>>e[i];
    }
    
    for(int i=0; i<n; i++){
        //cin>>d;
        //cin>>e;
        
        for(int j=0; j<(int)(d[i].size()); j++){
            st1.push(d[i][j]);
        }
        for(int j=0; j<(int)(e[i].size()); j++){
            st2.push(e[i][j]);
        }
        int temp=0;
        char temp_char;
        while(st1.empty()==false||st2.empty()==false){
            if(st1.empty()==false&&st2.empty()==false){
                temp_char=st1.top();
                temp+=atoi(&temp_char);
                temp_char=st2.top();
                temp+=atoi(&temp_char);
                st1.pop();
                st2.pop();
            }else if(st1.empty()==false&&st2.empty()==true){
                temp_char=st1.top();
                temp+=atoi(&temp_char);
                st1.pop();
            }else if(st1.empty()==true&&st2.empty()==false){
                temp_char=st2.top();
                temp+=atoi(&temp_char);
                st2.pop();
            }
            st3.push(temp%10);
            temp=temp/10;
        }
        
        if(temp!=0){
            st3.push(temp);
        }
        
        if(st3.size()>=80){
            printf("overflow");
        }else{
            while(st3.empty()==false){
                printf("%d",st3.top());
                st3.pop();
            }
        }
        printf("\n");
        
        
    }
    
}

C++: #include <iostream>
#include <vector>
#include<string>
#include<sstream>
#define CAPACITY 9


namespace jisaku{//stoi?????¨?????????????????????????????????????????§??£?¨???????

	int stoi(std::string str){
		int ret;
		std::stringstream ss;
		ss << str;
		ss >> ret;
		return ret;
	}

     std::string to_string(int i){
		 std::string text;
		std::stringstream textline;
		textline<< i;
		textline >> text;
		return text;
	}

}




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_rest,str_Max;

	str_rest = str.length() % CAPACITY;
	str_Max = str.length() / 9;

	for (int j = str.length() - CAPACITY; str_Max > 0; j = j - CAPACITY){
		num_str[k] = jisaku::stoi(str.substr(j, CAPACITY));
		loc = k;
		k--;
		str_Max--;

	}
	//?????????????????????????????????????????\??????

	if (str_rest != 0)num_str[loc - 1] = jisaku::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;
	std::string text;


	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++;
				text+=jisaku::to_string(num_ans[j]);
			}
			else if (num_ans[j] == 0 && count >= 1){
				for (int l = 0; l < 8; l++){
					text+="00000000";
				}

			}

		}std::cout <<text<< 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);
		if (str_a == "0" && str_b == "0"){std::cout << "0" << std::endl;
		}
		else if (str_a.length() >= 81 || str_b.length() >= 81){
		
			std::cout << "overflow" << std::endl;
		}
		else{

			OverDigit OverDigit_a(str_a, str_b);//???????????§??????
			OverDigit_a.Add();
		}
	}
	return 0;
}