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

int main()
{
	string s1, s2, temp;
	int sum, flag;
	int a, b;
	vector<int> v;
	int T;
	cin >> T;
	while (T--)
	{
		cin >> s1 >> s2;
		v.clear();
		sum = 0;
		flag = 0;
		reverse(s1.begin(), s1.end());
		reverse(s2.begin(), s2.end());
		if (s1.size() < s2.size())
		{
			temp = s1;
			s1 = s2;
			s2 = temp;
		}
		for (int i = 0; i < s1.size(); ++i)
		{
			if (s1[i] == '0')a = 0;
			else if (s1[i] == '1')a = 1;
			else if (s1[i] == '2')a = 2;
			else if (s1[i] == '3')a = 3;
			else if (s1[i] == '4')a = 4;
			else if (s1[i] == '5')a = 5;
			else if (s1[i] == '6')a = 6;
			else if (s1[i] == '7')a = 7;
			else if (s1[i] == '8')a = 8;
			else if (s1[i] == '9')a = 9;
			if (i >= s2.size())b = 0;
			else
			{
				if (s2[i] == '0')b = 0;
				else if (s2[i] == '1')b = 1;
				else if (s2[i] == '2')b = 2;
				else if (s2[i] == '3')b = 3;
				else if (s2[i] == '4')b = 4;
				else if (s2[i] == '5')b = 5;
				else if (s2[i] == '6')b = 6;
				else if (s2[i] == '7')b = 7;
				else if (s2[i] == '8')b = 8;
				else if (s2[i] == '9')b = 9;
			}
			sum = a + b + flag;
			if (sum > 9)
			{
				sum = sum - 10;
				flag = 1;
			}
			else
			{
				flag = 0;
			}
			v.push_back(sum);
		}
		if (flag == 1)
			v.push_back(1);
		if (v.size() > 80)
			cout << "overflow" << endl;
		else
		{
			for (int i = v.size() - 1; i >= 0; --i)
			{
				cout << v[i];
			}
			cout << endl;
		}
	}
	return 0;
}

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

int count(int data[]){
	int cnt = 0,i=0;
	while(1){
		if(data[i] == 10)break;
		cnt++;
		i++;
	}
	return cnt;
}

void sum(char data1[],char data2[],int ans[]){
	int i;
	for(i = 0;i < strlen(data1) || i < strlen(data2);i++){
		int st1,st2,st3;
		if(i >= strlen(data1)){
			st1 = 0;
		}else{
			st1 = data1[strlen(data1)-i-1];
			st1 = st1 - 48;
		}
		if(i >= strlen(data2)){
			st2 = 0;
		}else{
			st2 = data2[strlen(data2)-i-1];
			st2 = st2 - 48;
		}
		st3 = st1 + st2;
		if(st3 >= 10){
			if(ans[i] == 1){
				ans[i] = st3 - 9;
				ans[i + 1] = 1;
			}else{
				ans[i] = st3 - 10;
				ans[i + 1] = 1;
			}
		}else{
			if(ans[i] == 1){
				if(st3 == 9){
					ans[i] = 0;
					ans[i + 1] = 1;
				}else{
					ans[i] = st3 + 1;
				}
			}else{
				ans[i] = st3;
			}
		}
	}
	if(ans[i] == 1){
		ans[i + 1] = 10;
	}else{
		ans[i] = 10;
	}
}

int main(void){
	int cnt,i;
	scanf("%d",&cnt);
	for(i = 0;i < cnt;i++){
		int ans[82];
		char data1[82],data2[82];
		scanf(" %80s",data1);
		fflush(stdin);
		scanf(" %80s",data2);
		fflush(stdin);
		if(strlen(data1) > 80 || strlen(data2) > 80){
			printf("overflow\n");
		}else{
			sum(data1,data2,ans);
			if(count(ans) >= 80){
				printf("overflow\n");
			}else{
				int j;
				for(j = count(ans)-1;j >= 0;j--){
					printf("%d",ans[j]);
				}
				printf("\n");
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[90],b[90],ans[90];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			if(mlen>79){
				//cout<<"overflow"<<endl;
				continue;
			//}
			//cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			//cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

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

using namespace std;

int main() {

	int n;

	cin >> n;

	for (int i = 0; i < n; ++i) {
		bool carry = false;
		string first, second;
		cin >> first >> second;

		string sum;

		auto it1 = first.rbegin();
		auto it2 = second.rbegin();
		while (it1 != first.rend() || it2 != second.rend()) {

			int temp1 = (it1 != first.rend()) ? (*it1++) - '0' : 0;
			int temp2 = (it2 != second.rend()) ? (*it2++) - '0' : 0;
			int temp_sum = temp1 + temp2 + (carry ? 1 : 0);
			if (temp_sum / 10 != 0) {
				carry = true;
				temp_sum %= 10;
			}
			else {
				carry = false;
			}

			sum.insert(0, to_string(temp_sum));
		}
		if (carry == true) {
			sum.insert(0, 1, '1');
		}

		if (first.length() > 80 || second.length() > 80 || sum.length() > 80) {
			cout << "overflow" << endl;
		}
		else {
			cout << sum << 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 a, b;
    cin >> a >> b;
    int alen = a.length();
    int blen = b.length();
    int maxlen = max(alen, blen);
    vector<int> a_vec(maxlen, 0);
    vector<int> b_vec(maxlen, 0);
    vector<int> c_vec(maxlen + 1, 0); // carry
    vector<int> r_vec; // result
    for (int i = 0; i < alen; i ++) {
      a_vec[alen - i - 1] = (a[i] - '0');
    }
    for (int i = 0; i < blen; i ++) {
      b_vec[blen - i - 1] = (b[i] - '0');
    }
    for (int i = 0; i < maxlen; i ++) {
      c_vec[i + 1] = (a_vec[i] + b_vec[i] + c_vec[i]) / 10;
      r_vec.insert(r_vec.begin(), (a_vec[i] + b_vec[i] + c_vec[i]) % 10);
      if (i == maxlen - 1 && c_vec[maxlen] != 0) {
        r_vec.insert(r_vec.begin(), c_vec[maxlen]);
      }
    }
    if (alen > 80 || blen > 80 || r_vec.size() > 80) {
      cout << "overflow" << endl;
      continue;
    }
    for (auto itr = r_vec.begin(); itr != r_vec.end(); ++itr) {
      cout << *itr;
    }
    cout << endl;
  }
}

C++: #include <stdio.h>

void rev_str(char str[1024]) {
	int length = 0;
	char str2[1024];
	int temp;

	int i;

	for(i = 0; i < 1024; i++)
		str2[i] = '\0';

	while(str[length])
		length++;

	temp = length;
	i = 0;
	while(temp) {
		str2[temp - 1] = str[i];
		i++;
		temp--;
	}

	for(i = 0; i < length; i++)
		str[i] = str2[i];
}

int exor(int a, int b) {
	if(a && b)
		return 0;
	else if(a || b)
		return 1;
	else
		return 0;
}

int main() {
	char input_a[1024];
	char input_b[1024];
	char ans[286][1024];
	char kuriagari;
	int temp;
	int n;

	int i, j;

	scanf("%d", &n);

	for(j = 0; j < n; j++) {
		for(i = 0; i < 1024; i++) {
			input_a[i] = '\0';
			input_b[i] = '\0';
			ans[j][i] = '\0';
		}

		kuriagari = 0;

		scanf("%s", input_a);
		scanf("%s", input_b);

		rev_str(input_a);
		rev_str(input_b);

		i = 0;
		while(input_a[i] && input_b[i]) {
			temp = input_a[i] + input_b[i] - 2 * '0' + kuriagari;
			ans[j][i] = temp % 10 + '0';
			kuriagari = temp / 10;
			i++;
		}

		if(kuriagari && !input_a[i] && !input_b[i]) {
			ans[j][i] = kuriagari + '0';
		}

		else {
			while (kuriagari && exor((int)input_a[i], (int) input_b[i])) {
				temp = input_a[i] + input_b[i] - '0' + kuriagari;
				ans[j][i] = (char)(temp % 10 + '0');
				kuriagari = temp / 10;
				i++;
			}

			if (kuriagari)
				ans[j][i] = kuriagari + '0';
		}

		while(input_b[i]) {
			ans[j][i] = input_b[i];
			i++;
		}

		while(input_a[i]) {
			ans[j][i] = input_a[i];
			i++;
		}

		rev_str(ans[j]);
		
		if(ans[j][81])
			printf("overflow");
		else
			printf("%s", ans[j]);

		putchar('\n');

	}

	return 0;
}