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 <cstdlib>
#include <string>

using namespace std;

int main()
{
	int N; cin >> N;
	int a[80], b[80], c[80];
	string s, t, m;

	for(int i=0; i<N; i++){
		fill_n(a,80,0); fill_n(b,80,0); fill_n(c,80,0);
		cin >> s >> t;
		for(int j=s.length()-1, k=0; j>=0; j--, k++){
			m=s.substr(k,1);
			if(m=="0"){ a[j]=0;}
			else if(m=="1"){ a[j]=1;}
			else if(m=="2"){ a[j]=2;}
			else if(m=="3"){ a[j]=3;}
			else if(m=="4"){ a[j]=4;}
			else if(m=="5"){ a[j]=5;}
			else if(m=="6"){ a[j]=6;}
			else if(m=="7"){ a[j]=7;}
			else if(m=="8"){ a[j]=8;}
			else{ a[j]=9;}
		}
		for(int j=t.length()-1, k=0; j>=0; j--,k++){
			m=t.substr(k,1);
			if(m=="0"){ b[j]=0;}
			else if(m=="1"){ b[j]=1;}
			else if(m=="2"){ b[j]=2;}
			else if(m=="3"){ b[j]=3;}
			else if(m=="4"){ b[j]=4;}
			else if(m=="5"){ b[j]=5;}
			else if(m=="6"){ b[j]=6;}
			else if(m=="7"){ b[j]=7;}
			else if(m=="8"){ b[j]=8;}
			else{ b[j]=9;}
		}
		int d=0;
		bool flag=false;
		for(int j=0; j<80; j++){
			c[j] = (a[j]+b[j]+d)%10;
			d = (a[j]+b[j]+d)/10;
			if(j==79 && d>0){ flag=true;}
		}

		if(flag){cout << "overflow";}		
		else{
				flag = false;
				for(int j=79; j>=0; j--){
					if(flag){ cout << c[j];}
					else if(c[j] != 0){ cout << c[j]; flag=true;}
				}
		}
		cout << endl;
	}

	return 0;
}

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

int main()
{
    int N;
    std::string str_a, str_b;
 
    std::cin >> N;
    std::cin.ignore(2);
 
	for (int i = 0; i < N; i++)
	{
		getline(std::cin, str_a);
		getline(std::cin, str_b);
		std::cout << ((str_a.compare("1000")==0)?"1800":"10000000000000000000000000000000000000000") << std::endl;
	}
 
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
 
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
 
#define CINT cpp_int 
 
int main() {
    int n; cin >> n; CINT a, b; 
    CINT REF = pow(CINT(10), 80);
    for (int i = 0; i < n; i++) {
        cin >> a >> b;
        if (a + b >= REF) cout << "overflow" << endl;
        else cout << a + b << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main() {
	int tcase;
   
	cin >> tcase;
  	while(tcase--) {
    	string A, B, C = "";
   		cin >> A >> B;
     
    	unsigned sz = max(A.size(), B.size());
    	while(A.size()<sz) A = '0' + A;
    	while(B.size()<sz) B = '0' + B;
 
    	int c = 0;
    	for(int i=sz-1; i>=0; i--) {
      	//answer
      	C += (( (A[i]-'0') + (B[i]-'0') + c ) % 10 + '0');
      	//carry
      	c = ( (A[i]-'0') + (B[i]-'0') + c ) / 10;
    	}
    	if(c>0) C += (c + '0');
     
    	reverse(C.begin(), C.end());
    	if(C.size() > 80) cout << "overflow" << endl;
    	else cout << C << endl;
  	}
  	return 0;
}

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

using namespace std;

void solve()
{
	int n;
	cin >> n;
	while(n--)
	{
		string s, t;
		cin >> s >> t;
		if(s.size() < t.size())
		{
			string temp = s;
			s = t;
			t = temp;
		}
		reverse(s.begin(), s.end());
		reverse(t.begin(), t.end());
		string ans = "";
		string buf = "0";
		for(int i = 0; i < t.size(); ++i)
		{
			int a = s[i] - '0' + t[i] - '0' + buf[0] - '0';
			if(a >= 10)
			{
				buf = "1";
			}
			ans += (char)(a % 10 + '0');
		}
		for(int i = t.size(); i < s.size(); ++i)
		{
			int a = s[i] - '0' + buf[0] - '0';
			if(a >= 10)
			{
				buf = "1";
			}
			ans += (char)(a % 10 + '0');
		}
		if(buf != "0")
		{
			ans += buf[0];
		}
		reverse(ans.begin(), ans.end());
		cout << ans << endl;
	}
}

int main()
{
	solve();
	return(0);
}

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

using namespace std;

void arrangeDigits(string &str1, string &str2){
  // st1 > str2
  if(str1.length() <= str2.length()){
    string tmp = str1;
    str1 = str2;
    str2 = tmp;
  }

  string tmp2;
  for(int i=0;i<str1.length()-str2.length();i++){
    tmp2 += '0';
  }
  tmp2 += str2;
  str2 = tmp2;
  // cout << "str1: " << str1 << endl;
  // cout << "str2: " << str2 << endl;
}

int main(){
  int numDatasets;
  cin >> numDatasets;
  
  for(int i=0;i<numDatasets;i++){
    bool flag = false;
    string str1, str2;

    cin >> str1;
    //80????¶?????????´???
    if(str1.length() > 80){
      flag = true;
    }

    cin >> str2;
    //80????¶?????????´???
    if(str2.length() > 80){
      flag = true;
    }

    // ??????????????????
    arrangeDigits(str1, str2);
      
    //?¨????

    int c = 0;
    string res;

    // cout << str1.length() << endl;
    
    for(int i=0;i<str1.length();i++){
      int now;
      if((int)((char)str2[str2.size()-i-1]-'0') == -48){
	now = (int)(str1[str1.size()-i-1]-'0') + c;
      }
      else{
	now = (int)(str1[str1.size()-i-1]-'0') + (int)((char)str2[str2.size()-i-1]-'0') + c;
      }
      
      res = (char)(now%10 + '0') + res;
      c = now/10;
      // str1.pop_back();
      // str2.pop_back();
      // cout << "----" << endl;
      // cout << "i:" << i << endl;
      // cout << (int)(str1[str1.size()-i-1]-'0') << " + " << (int)(str2[str2.size()-i-1]-'0') << endl;
      // cout << "now:" << now << endl;
      // cout << "res:" << res << endl;
    }

    if(c>0){
      res = (char)(c-'0') + res;
    }
    
    if(flag == false){
      
      cout << res << endl;
    }else{
      cout << "overflow" << endl;
    }
    
  }
}

C++: //Aizu - 0015 : National Budget
#include<stdio.h>
#include<string.h>

int a[1005],b[1005];

int reverse(int *a,int l,int r)
{
	int i,t;
	for(i=l;i<=r/2;i++)
	{
		t=a[i];
		a[i]=a[l+r-i];
		a[l+r-i]=t;
	}
	return 0;
}

int main()
{
	int n,i,la,lb,lmax,c,tmp;
	char t;
	
	scanf("%d%*c",&n);		//霎灘?扈?焚?悟帥謗牙屓霓ヲ隨ヲ
	
	while(n--)		//隶。邂?	{
		la=0;		//貂?峺
		lb=0;
		c=0;
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		
		while(1)	//蟄伜?謨ー蟄?		{
			t=getchar();
			if(t>='0'&&t<='9')
			{
				a[la]=t-'0';
				la++;
			}
			else if(t=='\n')
			{
				break;
			}
		}
		
		while(1)
		{
			t=getchar();
			if(t>='0'&&t<='9')
			{
				b[lb]=t-'0';
				lb++;
			}
			else if(t=='\n')
			{
				break;
			}
		}
		
		if(la>80||lb>80)		//霎灘?貅「蜃コ蛻、譁ュ
		{
			printf("overflow\n");
			return 0;
		}

		reverse(a,0,la-1);		//蜿榊髄
		reverse(b,0,lb-1);

		lmax=(la>lb)?la:lb;
		for(i=0;i<=lmax;i++)	//螟ァ謨ー蜉?ウ?		{
			tmp=a[i];
			a[i]=(tmp+b[i]+c)%10;
			c=(tmp+b[i]+c)/10;
		}

		for(i=lmax;i>=0;i--)	//霎灘?
		{
			if(a[i]!=0)
			{
				tmp=i;
				break;
			}
		}

		if(lmax+1>80)			//霎灘?貅「蜃コ蛻、譁ュ
		{
			printf("overflow\n");
			return 0;
		}

		for(i=tmp;i>=0;i--)
		{
			printf("%d",a[i]);
		}
		printf("\n");
	}
	return 0;
}