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 <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <stack>

using namespace std;

int main (int argc, char * const argv[]) {
    // insert code here...
	int n;
    string a, b;
		
	cin>> n;	
	for(int i=0;i<n;i++){
		int x[81]={0}, y[81]={0}, z[81]={0};

		cin >> a;
		cin >> b;
		
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		
		for(int j=0;j<a.size();j++){
			x[j]=a[j]-'0';
		}
		for(int j=0;j<b.size();j++){
			y[j]=b[j]-'0';
		}
		
		for(int j=0;j<80;j++){
			z[j]+=x[j]+y[j];
			if(z[j]>=10){
				z[j+1]++;
				z[j]-=10;
			}
		}
		
		if(z[80]>0){
			cout << "overflow" <<endl;
		}else{
			bool flag = 0;
			for(int j=79;j>=0;j--){
				if(z[j]==0&& flag==0){
					continue;
				}else{
					flag=1;
				}
				cout<<z[j];
			}
			if(flag==0){
				cout<<0;
			}
			cout<<endl;
			
		}
		
	}
	
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
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 <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, j, n;
  int len1, len2;
  char tmp;

  scanf("%d",&n);
  rep(i,n){
    string str1, str2, res;
    cin >> str1;
    cin >> str2;

    vector<int> a(200, 0), b(200, 0);
    len1 = (int)str1.size(); len2 = (int)str2.size();
    if(len1 > 80) cout << "overflow" << endl;
    if(len2 > 80) cout << "overflow" << endl;
    rep(j,len1) a[j] = str1[(int)len1-1-j] - '0';
    rep(j,len2) b[j] = str2[(int)len2-1-j] - '0';

    rep(j,200){
      int sum = a[j] + b[j];
      if(sum >= 10){ sum %= 10; a[j+1]++;}
      res += (sum + '0');
    }

    reverse(res.begin(), res.end());
    int f = 0;
    string tmp;
    rep(j,res.size()){
      if(res[j] != '0') f = 1;
      if(f) tmp += res[j];
    }

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

  return 0;
}

C++: //0015 National Budget
//80ÜÅÌ2ÂÌ®Ì«µZÊðoÍ¹æ
//1sÚÉf[^Zbgnª^¦çêé
//^¦çê½â»Ìaª80ð´¦½êAoverflowÆoÍµÄ­¾³¢

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;


int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		const int N = 80;
		int i;
		string a, b;
		//0ú»
		char c[N+2] = "";

		cin >> a >> b;

		//vZµâ·¢æ¤É½]
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());

		int aSize, bSize;
		aSize = a.size();
		bSize = b.size();

		//Ü¸ÍAcÉ»ÌÜÜlðüêÄ¢­
		for(int i = 0; i < min( max(aSize, bSize), N); i++)
		{
			int s = 0;
			if(i < aSize)
				s += a[i] - '0';
			if(i < bSize)
				s += b[i] - '0';

			c[i] += s;
			c[i+1] += c[i]/10;
			c[i] %= 10;
		}

		//ã©ç©Ä¢ÁÄA0ÈOÌ¶ª»ê½ç¶»·é
		bool isAnswer = false;
		for(i = sizeof(c)-1; i >= 0; i--)
		{
			if(c[i])
				isAnswer = true;
			if(isAnswer)
				c[i] += '0';
		}
		//½]µÄ®¬
		reverse(c, c+strlen(c));

		//àµà80¶ÚªNULL¶Å êÎI[o[t[
		if(c[N])
			cout << "overflow" << endl;
		else
			cout << c << endl;
	}
	return 0;
}

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

void ctod(char *c, int *d){
	int len = strlen(c);
	char ct[10];
	int h = len / 9;
	int a = len % 9;

	for(int i=0;i<9;++i){
		d[i] = 0;
	}
	if(a != 0){
		memcpy(ct, c, a);
		ct[a] = '\0';
		d[h] = atoi(ct);
	}

	for(int i=0; i<h; ++i){
		memcpy(ct, c + len - 9*(i + 1), 9);
		ct[9] = '\0';
		d[i] = atoi(ct);
	}
}

void dtoc(char *c, int *d){
	char ct[10];
	int m = -1;
	int o = 0;
	for(int i=8; i>=0; --i){
		if(d[i] != 0){
			m = i;
			break;
		}
	}
	if(m == -1){
		c[0] = '0';
		c[1] = '\0';
		return;
	}

	sprintf(ct, "%d", d[m]);
	o = strlen(ct);
	memcpy(c, ct, 9);
	for(int i = m-1; i>=0; --i){
		sprintf(ct, "%09d", d[i]);
		memcpy(c+o, ct, 9);
		o += 9;
	}
	c[o] = '\0';
}

void add(int *d1, int *d2, int *d){
	int s = 0;
	for (int i=0; i<9; ++i){
		d[i] = d1[i] + d2[i] + s;
		s = d[i] / 1000000000;
		d[i] -= 1000000000 * s;
	}
}

int main(void){
	int n = 0;
	char i1[255], i2[255], o[255];
	int d1[9], d2[9], d[9];

	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%s", i1);
		scanf("%s", i2);
		if(strlen(i1) > 80 || strlen(i2) > 80){
			puts("overflow");
			continue;
		}

		for(int j=0; j<9;++j){
			d1[j] = d2[j] = d[j] = 0;
		}
		ctod(i1, d1);
		ctod(i2, d2);
		add(d1, d2, d);
		dtoc(o, d);
		if(strlen(o) > 80){
			puts("overflow");
			continue;
		}
		printf("%s\n", o);
	}
	return 0;
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
string s1, s2;
int main(void) {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        vector<int> ans;
        cin >> s1;
        cin >> s2;
        int size1 = s1.size();
        int size2 = s2.size();
        if (size2 > size1) {
            swap(size1, size2);
            swap(s1, s2);
        }
        size1++;
        reverse(s1.begin(), s1.end()); reverse(s2.begin(), s2.end());
        s1 += "0";
        for (int i = 0; i + size2 < size1; i++) {
            s2 += "0";
        }
        //    cout << s1 << endl;
        //    cout << s2 << endl;
        int old = 0;
        for (int i = 0; i < size1; i++) {
            int tmp = (s1[i]-'0') + (s2[i]-'0') + old;
            //        cout << tmp << endl;
            ans.push_back(tmp % 10);
            old = tmp / 10;
        }
        if (ans[size1-1] == 0) size1--;
        if (size1 > 80) {
            cout << "overflow" << endl;
            continue;
        }
        for (int i = size1-1; i >= 0; i--) {
            cout << ans[i];
        }
        cout << endl;
    }
    return 0;
}