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<algorithm>
#include<string>


#define MAX 1000


using namespace std;


int main()
{
	int n = 0;
	string in[2];
	char out[MAX] = {NULL};

	cin >> n;

	for (int i = 0; i < n; i++){
		cin >> in[0] >> in[1];

		for (int i = 0; i < MAX; i++){
			out[i] = '\0';
		}

		int count = in[0].size() - 1;

		for (int i = 0; i < in[0].size(); i++){
			out[count--] += in[0][i];
		}

		count = in[0].size();
		int count2 = in[1].size() - 1;

		count = max(count , count2) - 1;

		for (int i = 0; i < in[1].size(); i++){
			if (out[i] != '\0'){
				out[i] -= '0';
			}
			out[i] += in[1][count2--];
			count--;
		}
		
		int i = 0;
		for (i = 0; out[i] != '\0'; i++){
			;
		}

		bool flag = false;


		for (int j = 0; j < i; j++){
			if (out[j] > '9'){
				out[j] -= 10;
				out[j + 1] += 1;
			}
		}

		if (out[i] > '\0' && out[i] < '0'){
			out[i] += '0';
		}
		
		for (i = 0; i < out[i] != '\0'; i++){
			;
		}

		for (int j = 0; j < i / 2; j++){
			char tmp = out[j];
			out[j] = out[i - j - 1];
			out[i - j - 1] = tmp;
		}

		for (i = 0; out[i]; i++){
			;
		}

		if (i >= 79 || (flag == true && i >= 79)){
			cout << "overflow" << endl;
		}else{
			cout << out << endl;
		}
	}

	return 0;
}

C++: #include <cstdio>
#include <cstring>
#define MAX_NUM 32767

using namespace std;

void array_add(int *a,int *b){
	int i;
	for(i = MAX_NUM - 1;i > 0;i--){
		a[i] = a[i] + b[i];
		a[i - 1] = a[i - 1] + a[i] / 10;
		a[i] %= 10;
	}
}

int main(void){
	int n, i, j, len1,len2, val1[MAX_NUM], val2[MAX_NUM];
	char c;
	scanf("%d%*c",&n);
	for(i = 0;i < n;i++){
		for(j = 0;(c = getchar()) != '\n';j++){
			val1[j] = c - '0';
		}
		len1 = j;
		for(j = 0;(c = getchar()) != '\n';j++){
			val2[j] = c - '0';
		}
		len2 = j;
		for(j = MAX_NUM - 1;j > MAX_NUM - 1 - len1;j--){
			val1[j] = val1[len1 - 1 + (j - (MAX_NUM - 1))];
		}
		for(;j >= 0;j--){
			val1[j] = 0;
		}
		val1[MAX_NUM] = 0;
		for(j = MAX_NUM - 1;j > MAX_NUM - 1 - len2;j--){
			val2[j] = val2[len2 - 1 + (j - (MAX_NUM - 1))];
		}
		for(;j >= 0;j--){
			val2[j] = 0;
		}
		array_add(val1,val2);
		for(j = 0;val1[j] == 0 && j < MAX_NUM;j++);
		if(j <= MAX_NUM - 81)
			printf("overflow");
		else if(j == MAX_NUM)
			printf("0");
		else{
		for(;j < MAX_NUM;j++){
			printf("%d",val1[j]);
		}
		}
		printf("\n");
	}
	return 0;
}

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

using namespace std;

class OverDigit{

public:

	int num_a[9];
	int num_b[9];
	OverDigit(string str_a, string str_b);
	void ChangeDigit(string str,int num[]);
	void Add();
};

OverDigit::OverDigit(string str_a,string str_b){

	ChangeDigit(str_a, num_a); 
	ChangeDigit(str_b, num_b);	
}

void OverDigit::ChangeDigit(string str, int num[]){

	vector <int> num_str(9, 0);
	int loc = 9, k = 8;
	int str_Max, str_rest;

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


	for (int j = str.length() - 9; str_Max > 0; j = j-9){
		num_str[k] = stoi(str.substr(j, 9));
		loc = k;
		k--;
		str_Max--;
	}
	//?????????????????????????????????????????\??????
	num_str[loc - 1] = stoi(str.substr(0, str_rest));

	for (int j = 0; j < 9; j++){
	num[j]=num_str[j];
	}
}
//80????????§????¶???????
void OverDigit::Add(){

	int num_ans[9] = {};
	int fat,overflow=0,count=0;

	for (int j = 8; 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 && j!=1){
			fat = (num_a[j] + num_b[j]) - 1000000000;
			num_ans[j] = fat;
			num_a[j - 1]++;		
		}
		else if (num_a[j] + num_b[j] > 999999999 && j ==1 ){
			overflow = 1;
		}
	
	}

	if (overflow == 1){
		cout << "overflow" << endl;
	}
	else {
		for (int j = 0; j < 9; j++){
			if (num_ans[j] != 0){
				count++;
				cout << num_ans[j];

			}
			else if (num_ans[j] == 0 && count >= 1){
				cout << "000000000";
			}

		}cout << endl;
	}

};


int main(){

	//vector???????????¨??????80???????¨????
	int N;
	string str_a, str_b;

	cin >> N;
	cin.ignore();

	for (int i = 0; i < N; i++){
		getline(cin, str_a);
		getline(cin, str_b);
		OverDigit OverDigit_a(str_a,str_b);//???????????§??????
		OverDigit_a.Add();
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdlib>
#include<stdio.h>

int inttostring(char *x,int n){
  return sprintf(x,"%d",n);
}

int main(){
  std::string a;
  std::string b;
  char sum[102];
  int num_a,num_b,num_sum,size_sum;
  int n;

  std::cin >> n;

  for(int i=0;i<n;i++){
    std::cin >> a >> b;
    num_a = std::atoi(&a[0]);
    num_b = std::atoi(&b[0]);

    num_sum = num_a+num_b;
    //sum = std::to_string(num_sum);

    size_sum = inttostring(sum,num_sum);

    if(size_sum>80){
      std::cout << "overflow" << std::endl;
      break;
    }

    std::cout << sum << std::endl;
  }
  //std::cout << num_a << std::endl;
  //std::cout << num_b << std::endl;
}