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>
using namespace std;
int main() {
  string a,b,c="",res;
  int n,l=0,d=0,carry=0;
  bool flag;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a>>b;

    if(a.length() > 80 || b.length() > 80) {
      cout<<"overflow"<<"\n";
      goto NEXT;
    }

    l = min(a.length(),b.length());
    flag = a.length() > b.length();
    d=0;
    carry=0;

    for(int i=0; i<l; i++){
      d = a.at(a.length()-i-1) + b.at(b.length()-i-1) - 96 + carry;
      carry=0;
      if(d>9) {
	carry = d/10;
	d %= 10;
      }
      c+=string( 1, d+48 );
    }

    if(flag){
      for(int i=l;i<a.length(); i++){
	d = a.at(a.length()-i-1) -48 + carry;
	carry=0;
	if(d>9){
	  carry = d/10;
	  d %= 10;
	}
	c+= string( 1, d+48 );
      }
    } else {
      for(int i=l;i<b.length(); i++){
	d = b.at(b.length()-i-1) -48 + carry;
	carry=0;
	if(d>9){
	  carry = d/10;
	  d %= 10;
	}
	c+= string( 1, d+48 );
      }
    }

    if(carry) c+= string ( 1, '1' );

    res = string(c.rbegin(),c.rend());

    if(res.length() >80) {
      cout<<"overflow"<<endl;
      goto NEXT;
    }

    cout<<res<<endl;

  NEXT:
    res="";
    c="";
  }
}

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 + 1 < size + 10; leng1++);//length of str1
		for(leng2 = 0; (int)str2[leng2 + 1] >= 48 && (int)str2[leng2 + 1] <= 57 && leng2 + 1 < size + 10; 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<vector>
#include<string>
#include<cstdlib>
using namespace std;

int main(void){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		string a, b;
		cin >> a >> b;
		if(a.size()>80 || b.size()>80) {cout << "overflow" << endl;}
		else{
			vector<int> x, y, z;
			for(int j=0; j<80; j++){
				x.push_back(0);
				y.push_back(0);
				z.push_back(0);
			}

			for(int j=0; j<a.size(); j++)
				x[j] = atoi( a.substr(a.size()-1-j,1).c_str() );
			for(int j=0; j<b.size(); j++)
				y[j] = atoi( b.substr(b.size()-1-j,1).c_str() );
			
			for(int j=0; j<80; j++){
				z[j] = x[j]+y[j];
			}
			for(int j=0; j<79; j++){
				if( z[j]>=10 ){
					z[j+1]++;
					z[j]-=10;
				}
			}
			if(z[79]>=10) {cout << "overflow" << endl;}
			else {
				bool zeroume = false;
				for(int j=0; j<80; j++){
					if(z[79-j]==0 && zeroume==false){}
					else{cout << z[79-j];zeroume=true;}
				}
				cout << endl;
			}
		}
	}
	return 0;
}

C++: /*
	0015:National Budget
*/
#include	<iostream>
#include	<string>
#include	<iterator>

using namespace std;

int main(void) {
	int n;
	
	cin >> n;
	for(int i = 0; i < n; i++) {
		string num1, num2, result;
		bool isMoveUp = false;
		
		cin >> num1 >> num2;
		string::reverse_iterator st1 = num1.rbegin();
		string::reverse_iterator st2 = num2.rbegin();
		while( st1 != num1.rend() || st2 != num2.rend()) {
			char buf1 = st1 != num1.rend() ? (*st1) : '0';
			char buf2 = st2 != num2.rend() ? (*st2) : '0';
			int buf3 = (buf1 - '0') + (buf2 - '0');
			
			isMoveUp = false;
			if(buf3 >= 10) {
				isMoveUp = true;
				(*(st1+1))++; buf3 -= 10;
			}
			result += (buf3 + '0');
			if(st1 != num1.rend()) { st1++; }
			if(st2 != num2.rend()) { st2++; }
		}
		if(isMoveUp) { result += '1'; }
		if(result.size() > 80) { cout << "overflow" << endl; continue; }
		string::reverse_iterator rt = result.rbegin();
		while(rt != result.rend()) {
			cout << (*rt);
			rt++;
		}
		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 in1,in2;
	int a[1000],b[1000],ans[1000];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		in1="";
		in2="";
		cin>>in1;
		cin>>in2;
		alen=in1.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in1[i]-'0';
			cout<<a[alen-1-i]<<endl;
		}cout<<endl;
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in2[i]-'0';
			cout<<b[blen-1-i]<<endl;
		}
		mlen=max(alen,blen);
		if(mlen>79){
			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;
			cout<<ans[i]<<endl;
		}
		if(ans[mlen]!=0){
			if(mlen>78){
				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 <bits/stdc++.h>
using namespace std;
int main ()
{
    int n;
    cin>>n;
    getchar();
    while (n--)
    {
        string ara="",ara2="",res="";
        getline(cin,ara);
        getline(cin,ara2);

        if (ara.length()>ara2.length())
            swap(ara,ara2);

        int l1,l2;
        l1=ara.length();
        l2=ara2.length();

        reverse(ara.begin(),ara.end());
        reverse(ara2.begin(),ara2.end());

        int i,sum,carry=0;
        for (i=0;i<l1;i++)
        {
            sum=((ara[i]-'0')+(ara2[i]-'0')+carry);
            res.push_back((sum%10)+'0');
            carry=sum/10;
        }
        for (i=l1;i<l2;i++)
        {
            sum=(ara2[i]-'0')+carry;
            res.push_back((sum%10)+'0');
            carry=sum/10;
        }
        if (carry!=0)
            res.push_back(carry+'0');
        reverse (res.begin(),res.end());
        if (res.length()<=80)
            cout<<res;
        else
            cout<<"overflow";
        cout<<endl;
    }
    return 0;
}

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

int main(){
    int n,x=0,i;
    cin>>n;
    while(n--){
        string a,b,c="";
        cin>>a>>b;
        if(a.length()>b.length())swap(a,b);
        b='0'+b;
        while(a.length()<b.length())
            a='0'+a;
        char m;
        for(i=a.length()-1;i>0;i--){
            m=('0'+(a[i]-'0'+b[i]-'0'+x)%10);
            x=(a[i]-'0'+b[i]-'0'+x)/10;
            c=m+c;
        }
        if(x>0){
            m=('0'+x);
            c=m+c;
        }
        cout<<c<<endl;
    }
}