Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

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 <cstdio>
#include <vector>
using namespace std;

int main(){
	const int size = 80;
	char str1[size + 10], str2[size + 10];
	int num1[size], num2[size], res[size];
	int n, leng1, leng2, loop, kuri;
	bool output;
	
	scanf("%d", &n);
	
	while(n--){
		fill(str1, str1 + size + 10, 0);
		fill(str2, str2 + size + 10, 0);
		fill(num1, num1 + size, 0);
		fill(num2, num2 + size, 0);
		scanf("%s", str1);
		scanf("%s", str2);
		
		//char -> int
		for(leng1 = 0; (int)str1[leng1 + 1] >= 48 && (int)str1[leng1 + 1] <= 57; leng1++);//length of str1
		for(leng2 = 0; (int)str2[leng2 + 1] >= 48 && (int)str2[leng2 + 1] <= 57; leng2++);//length of str2
		
		loop = 1;
		while(leng1 >= 0){
			num1[size - loop] = (int)str1[leng1] - 48;
			leng1--; loop++;
		}
		loop = 1;
		while(leng2 >= 0){
			num2[size - loop] = (int)str2[leng2] - 48;
			leng2--; loop++;
		}
		kuri = 0;
		for(int i = size - 1; i >= 0; i--){
			res[i] = num1[i] + num2[i] + kuri;
			kuri = res[i] / 10;
			if(kuri > 0) res[i] -= 10;
		}
		
		if(kuri > 0) printf("overflow\n");
		else{
			output = false;
			for(int i = 0; i < size; i++){
				if(!output && res[i] == 0) continue;
				else{
					output = true;
					printf("%d", res[i]);
				}
			}
			printf("\n");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;

int main()
{
	
	
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		string a;
		string b;

		cin >> a;
		cin >> b;	
		string res;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		int carry = 0;
		int idx;
		for(int j=0;j<min(a.size(),b.size());j++){
			int lhs = a[j] - '0';
			int rhs = b[j] - '0';
			res.push_back((carry + lhs + rhs) % 10 + '0');
			carry = (carry + lhs + rhs) / 10 ? 1 : 0;
			idx =j;
		}

		for(int j=idx+1;j<max(a.size(),b.size());j++){
			if(a.size() > b.size()){
				int lhs = a[j] - '0';
				res.push_back((carry + lhs) % 10 + '0');
				carry = (carry + lhs) / 10 ? 1 : 0;
			}
			else{
				int rhs = b[j] - '0';
				res.push_back((carry + rhs) % 10 + '0');
				carry = (carry + rhs) / 10 ? 1 : 0;
			}
		}
		if(carry) res.push_back(carry+'0');
		reverse(res.begin(),res.end());
		cout << res << endl;
	}	
}

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

int main(void)
{
	char str[2][1000];
	int b, s;
	int len[2];
	int i, j;
	int n;
	int flag;
	
	scanf("%d", &n);
	
	while (n){
		for (i = 0; i < 1000; i++){
			str[0][i] = str[1][i] = 0;
		}
		s = 1;
		b = 0;
		for (i = 0; i < 2; i++){
			scanf("%s", str[i]);
			len[i] = strlen(str[i]);
		}
		
		if (len[0] > 80 || len[1] > 80){
			printf("overflow\n");
		}
		else {
			if (len[0] < len[1]){
				s = 0;
				b = 1;
			}
			
			for (i = len[b], j = len[s]; i >= 0; i--, j--){
				if (j >= 0){
					str[s][i] = str[s][j];
				}
				else {
					str[s][i] = '0';
				}
			}
			
			flag = 0;
			i = len[b];
			while (i >= 0){
				if (str[s][i] + str[b][i] - '0' + flag > '9'){
					flag = 1;
				}
				else {
					flag = 0;
				}
				i--;
			}
			
			if (flag){
				for (i = len[b]; i >= 0; i--){
					for (j = 0; j < 2; j++){
						str[j][i + 1] = str[j][i];
					}
				}
				str[0][0] = '0';
				str[1][0] = '0';
			}
			
			for (i = len[b] + flag; i >= 0; i--){
				str[b][i] += (str[s][i] - '0');
				if (str[b][i] > '9'){
					str[b][i] -= 10;
					str[b][i - 1]++;
				}
			}
			str[b][len[b] + flag] = '\0';
			
			printf("%s\n", str[b]);
		}
		
		n--;
	}
	
	return (0);
}

C++: #include<iostream>
#include<string>
#include<math.h>
using namespace std;
int main() {
	int N,a,b,c,d,f;
	int e = 0;
	string s,t,u;
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 2; j++) {
			if (j == 0) {
				cin >> s;
			}
			else if (j == 1) {
				cin >> t;
			}
		}
		a = s.size();
		b = t.size();
		if (a < b) {
			c = a;
		}
		else if (a >= b) {
			c = b;
		}
		for (int k =c; k >= 0; k++) {
			d = s[c - 1] + t[c - 1];
			while (e == 1) {
				e = 0;
				d += 1;
			}
			if (d < 10) {
				u[c - k] = d;
			}
			else {
				u[c - k] = d - 10;
				e = 1;
			}
		}
		f = u.size();
		while (f > 80) {
			cout << "overflow" << endl;
			break;
		}
		while (f <= 80) {
			for (int i2 = 0; i2 < f; i2++) {
				cout<< u[f - 1 - i2];
			}
			break;
		}
	}
	return 0;
}