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<bits/stdc++.h>
using namespace std;

string ans;
string s1,s2;

void Calc(int up,int indx1,int indx2){


  if(indx1==-1){
    if(up!=0){ans.insert(ans.begin(),(char)(up+(int)'0'));}
    return;
  }


  if(indx2>=0){
    int work = s1[indx1]-'0' + s2[indx2]-'0' + up;

    up = work/10;
    work = work%10;

    ans.insert(ans.begin(),(char)((int)'0'+work));
  }

  else{
    int work = s1[indx1]-'0' + up;

    up = work/10;
    work = work%10;

    ans.insert(ans.begin(),(char)((int)'0'+work));
  }


  Calc(up,indx1-1,indx2-1);
}

int main(){

  char head1,head2;
  string tmp;
  int size;
  int n;


  cin >> n;

  for(int i=0; i<n; i++){
    ans="";
    cin >> s1;
    cin >> s2;
    if(s1.size()<s2.size()){ tmp=s1;s1=s2;s2=tmp; }

    if(s1.size()>=80 || s2.size()>=80)
      cout<<"overflow"<<endl;
    else if(s1.size()>=79 && s2.size()>=79 && s1[0]-'0'+s2[0]-'0'>=10)
      cout<<"overflow"<<endl;
    else{
      Calc(0,s1.size()-1,s2.size()-1);
      cout << ans << endl;
    }
  }

  return 0;
}

C++: #include <iostream>
#include <string>
??
using namespace std;
??
int main()
{
????????int num;
??
????????cin >> num;
????????for (int i = 0; i < num; i++) {
????????????????string s1, s2;
??
????????????????cin >> s1 >> s2;
????????????????if (s1.size() > 80 || s2.size() > 80)
????????????????????????cout << "overflow" << endl;
????????????????else {
????????????????????????int i1 = s1.size();
????????????????????????int i2 = s2.size();
????????????????????????string ans;
????????????????????????int tmp = 0;
????????????????????????int up = 0;
??
????????????????????????for ( ; (i1 > 0) && (i2 > 0); i1--, i2-- ) {
????????????????????????????????tmp = (s1[i1 - 1] + s2[i2 - 1]) - 2 * '0' + up;
????????????????????????????????up = tmp / 10;
????????????????????????????????tmp %= 10;
????????????????????????????????ans = char(tmp + '0') + ans;
????????????????????????}
??????????????????????????
????????????????????????if (i1 > 0) {
????????????????????????????????for ( ; i1 > 0; i1--) {
????????????????????????????????????????tmp = s1[i1 - 1] - '0' + up;
????????????????????????????????????????up = tmp / 10;
????????????????????????????????????????tmp %= 10;
????????????????????????????????????????ans = char(tmp + '0') + ans;
????????????????????????????????}
????????????????????????}
????????????????????????else if (i2 > 0) {
????????????????????????????????for ( ; i2 > 0; i2--) {
????????????????????????????????????????tmp = s2[i2 - 1] - '0' + up;
????????????????????????????????????????up = tmp / 10;
????????????????????????????????????????tmp %= 10;
????????????????????????????????????????ans = char(tmp + '0') + ans;
????????????????????????????????}
????????????????????????}
??
????????????????????????if (up > 0)
????????????????????????????????ans = char(up + '0') + ans;
??
????????????????????????if (ans.size() > 80)
????????????????????????????????cout << "overflow" << endl;
????????????????????????else
????????????????????????????????cout << ans << endl;
????????????????}
????????}
??
????????return 0;
}

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

typedef unsigned int uint;

#define max(a,b) (a>b?a:b)
#define min(a,b) (a>b?b:a)

int main() {
	string str; int c, l, n;
	vector<int> dig[2], dig2(85,0);
	cin >> n;
	while(n--) {
		for(int i=0; i<82; ++i) dig2[i] = 0;
		for(int i=0; i<2; ++i) {
			cin >> str;
			dig[i].clear();
			for(int j=(signed)str.length()-1; j>=0; --j) dig[i].push_back((int)(str[j]-'0'));
		}
		l = max(dig[0].size(), dig[1].size()); c=0;
		for(int i=0; i<l; ++i) {
			dig2[i] = (i<dig[0].size()?dig[0][i]:0)+(i<dig[1].size()?dig[1][i]:0)+c;
			c = dig2[i]/10; dig2[i] %= 10;
		}
		if(c) {dig2[l] = c; l++;}
		if(dig2[80]==0) {
			for(int i=0; i<l; ++i) cout << dig2[l-1-i];
			cout << endl;
		}else cout << "overflow" << endl;
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int N; cin >> N;
	for (int i = 0; i < N;i++) {
		string str1, str2;
		cin >> str1 >> str2;
		int f = 0;	//????????°?????????
		if (str1.length() > str2.length()) {
			string temp(str1.length() - str2.length() + 1,'0');
			str1 = '0' + str1;
			str2 = temp + str2;
		}
		else if (str1.length() < str2.length()) {
			string temp(str2.length() - str1.length() + 1, '0');
			str1 = temp + str1;
			str2 = '0' + str2;
		}
		string ans((int)str1.length(),'0');
		for (int i = str1.length()-1 ; i >= 0;i--) {
			int dig1 = str1[i] - '0', dig2 = str2[i] - '0';
			if (f + dig1 + dig2 >= 10) {
				ans[i] = (f + dig1 + dig2) % 10 +'0';
				f = 1;
			}
			else {
				ans[i] = (f + dig1 + dig2) + '0';
				f = 0;
			}
		}
		int size = ans.length();
		if (ans[0] == '0') size--;
		if (size > 80)cout << "overflow" << endl;
		else {
			if (ans[0] == '0') {
				cout << ans.substr(1) << endl;
			}
			else {
				cout << ans << endl;
			}
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i, n;

  cin >> n;
  while(n--){
    string s1, s2, tmp, res;

    cin >> s1;
    if((int)s1.size() > 80){
      cout << "overflow" << endl;
      continue;
    }
    cin >> s2;
    if((int)s2.size() > 80){
      cout << "overflow" << endl;
      continue;
    }

    vector<int> a(100,0);
    rep(i,s1.size()) a[i] = s1[(int)s1.size()-1-i] - '0';
    vector<int> b(100,0);
    rep(i,s2.size()) b[i] = s2[(int)s2.size()-1-i] - '0';

    rep(i,100){
      int sum = a[i] + b[i];
      if(sum >= 10){ sum %= 10; a[i+1]++;}
      tmp += sum + '0';
    }

    reverse(tmp.begin(), tmp.end());
    bool f = false;
    rep(i,tmp.size()){
      if(tmp[i] != '0') f = true;
      if(f) res += tmp[i];
    }

    if((int)res.size() > 80) cout << "overflow" << endl;
    else cout << res << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <stdio.h>

using namespace std;

int main()
{
	int i,j;
	string s1,s2;

	cin>>s1>>s2;
	
	if(s1.size()<s2.size())swap(s1,s2);

	for(i=0;i<s2.size();i++){s1[i+s1.size()-s2.size()]+=s2[i]-'0';}

	for(i=s1.size()-1;i>0;i--){
		if(s1[i]>'9'){s1[i]-=10; s1[i-1]++;}
	}

	if(s1[0]>'9'){s1[0]-=10;cout<<"1";}

	cout<<s1<<endl;

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;


string solve(string s1, string s2){

while(s1.size()<85){
s1 = '0' + s1;
}
while(s2.size()<85){
s2 = '0' + s2;
}
string ret = "";
int kuri = 0;
for(int i=0;i<80;i++){
int r = (int)(s1[s1.size()-1-i]-'0' + s2[s2.size()-1-i]-'0') + kuri;
kuri = r/10;
r = r%10;
ret = ((char)('0'+r)) + ret;
}
if (kuri>0) return "overflow"; else return ret;
}

int main(void){
int N;
cin >> N;
for(int i=0i<N;i++){
string s1, s2;
cin >> s1 >> s2;
cout << solve(s1, s2) << endl;
}
return 0;
}