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 ;

int f( char x ){
	switch (x){
		case '0' : return 0 ;
		case '1' : return 1 ;
		case '2' : return 2 ;
		case '3' : return 3 ;
		case '4' : return 4 ;
		case '5' : return 5 ;
		case '6' : return 6 ;
		case '7' : return 7 ;
		case '8' : return 8 ;
		case '9' : return 9 ;
	}
}

int main(){
	
	int n ;
	for( cin >> n ; n-- ; ){
		string a,b ;
		cin >> a >> b ;
		if( a.size() > b.size() ) swap(a,b) ;
		reverse( a.begin() , a.end() ) ;
		reverse( b.begin() , b.end() ) ;
		while( a.size() < b.size() ) a+='0' ;
		
		vector<int> c ;
		c.push_back(0) ;
		for( int i=0 ; i<a.size() ; i++ ){
			c[i] += f(a[i]) + f(b[i]) ;
			c.push_back( c[i]/10 ) ;
			c[i] %= 10 ;
		}
		if( c[c.size()-1] == 0 ) c.pop_back() ;
		reverse( c.begin() , c.end() ) ;
		
		if( c.size() >= 80 ) cout << "overflow" << endl ;
		else {
			for( int i=0 ; i<c.size() ; i++ ) cout << c[i] ;
			cout << endl ;
		}
	}
	
return 0 ;
}

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

int main() {

  int n;
  cin >> n;

  string c = "0123456789";

  for ( int i = 0; i < n; i++ ) {

    string input1,input2;
    cin >> input1 >> input2;

    string ans = "";

    int k = 0;
    for ( int j = 0; j < 80; j++ ) {

      int x = input1.size()-1-j;
      if ( x >= 0 ) {
	k += input1[x] - '0';
      }
      int y = input2.size()-1-j;
      if ( y >= 0 ) {
	k += input2[y] - '0';
      }
      ans = c[k%10] + ans;
      k /= 10;

    }

    if ( k != 0 ) {
      cout << "overflow" << endl;
    }else {
      bool flag = true;
      for ( int i = 0; i < ans.size(); i++ ) {
	if ( ans[i] == '0' && flag ) continue;
	flag = false;
	cout << ans[i];
      }
      if ( flag ) cout << "0";
      cout << endl;
    }

  }

  return 0;

}

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

string strplus(string x,string y){
  if(x.size()>80||y.size()>80)return "overflow";
  string ans="";
  int xa[80],ya[80],za[80];
  for(int i=0;i<80;i++)xa[i]=ya[i]=za[i]=0;
  for(int i=0;i<(int)x.size();i++)xa[i]=x[x.size()-1-i]-'0';
  for(int i=0;i<(int)y.size();i++)ya[i]=y[y.size()-1-i]-'0';
  for(int i=0;i<80;i++){
    za[i]+=xa[i]+ya[i];
    if(za[i]>=10){
      if(i==79)return "overflow";
      else za[i+1]++;
    }
    za[i]%=10;
  }
  int flg=0;
  for(int i=79;i>=0;i--){
    if(flg==0&&za[i]==0)continue;
    else{
      flg=1;
      ans.push_back(za[i]+'0');
    }
  }
  return ans;
}
int main(){
  int n;
  string a,b;
  cin>>n;
  while(n--){
    cin>>a>>b;
    cout<<strplus(a,b)<<endl;
  }
  return 0;
}

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

int main(){
	int n;
	cin >> n;
	while( n-- > 0 ){
		string num1, num2;
		cin >> num1 >> num2;
		char sum[101];
		int degit = 0;
		for( int i = 0; i < 101; i++ ) sum[i] = '0';
		for( int i = 0; i < num1.size(); i++ ){
			sum[100-i] = num1[num1.size()-i-1];
		}
		int d;
		for( int i = 0; i < num1.size() || i < num2.size() || degit != 0; i++ ){
			int now = 3;
			/*
			if( i < num2.size() ){
				now = (int)(sum[100-i]-'0') + (int)(num2[num2.size()-i-1]-'0') + degit;
			}else{
				now = (int)(sum[100-i]-'0') + degit;
			}
			*/
			sum[100-i] = (char)(now%10)+'0';
			if( now >= 10 ) degit = 1;
			else degit = 0;
			d = i;
		}
		int d = 3;
		if( d < 80 ){
			for( int i = 100-d; i < 101; i++ ) cout << sum[i];
			cout << endl;
		}else{
			cout << "overflow" << endl;
		}
	}
}

C++: #include <stdio.h>
#include <string.h>
#define N 80

int main(void){
    char buf[N*2];
    int datas;
    int degits;
    int lint1[N+1], lint2[N+1], sum[N+1];
    int cry;
    
    scanf("%d", &datas);
    for (int n=0; n<datas; n++){
        // reset
        for (int i=0; i<N; i++) lint1[i]=lint2[i]=0;
        // input
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint1[degits-i-1]= buf[i]-'0';
        }
        scanf("%s", buf);
        degits = strlen(buf);
        for (int i=0; i<degits; i++){
            lint2[degits-i-1]= buf[i]-'0';
        }
        // calc
        cry=0;
        for (int i=0; i<N; i++){
            sum[i] = lint1[i]+lint2[i] + cry;
            cry = sum[i]>9 ? 1:0;
            if (cry) sum[i] -= 10;
        }
        // output
        if (cry){
            puts("overflow");
        } else {
            bool zero=true;
            if (cry) puts("1");
            for (int i=N-1; i>=0; i--){
                if (zero && sum[i] != 0) zero=false;
                if (!zero) printf("%d", sum[i], i);
            }
            printf("\n");
        }
        
    }
    
    return 0;
}

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

int main(void){
	int n;
	std::cin >> n;
	char i1[81]="",i2[81]="",res[81]="";
	for(int i=0; i<n; i++){
		bool cflag=false;
		std::cin >> i1;
		if(strlen(i1)>80){
			std::cout << "overflow" << std::endl;
		}
		std::cin >> i2;
		if(strlen(i2)>80){
			std::cout << "overflow" << std::endl;
		}
		for(int j=0;j<80;j++){
			char c='0';
			if(cflag)
				c+=1;
			cflag=false;
			if(strlen(i1)>j){
				c+=i1[strlen(i1)-j-1]-'0';
			}
			if(strlen(i2)>j){
				c+=i2[strlen(i2)-j-1]-'0';
			}
			if(c > '9'){
				cflag=true;
				c-=10;
			}
			res[79-j]=c;
		}

		if(cflag){
			std::cout << "overflow" << std::endl;
		}else{
			char *p = res;
			while(*p++ == '0');
			std::cout << (p-1) << std::endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
using namespace std;
string toString(int n) {
    ostringstream os; os << n;
    return os.str();
}
string add(string a, string b) {
    if (a.size() > 80 || b.size() > 80) {
        return "overflow";
    }
    while (a.size() > b.size()) b = "0" + b;
    while (b.size() > a.size()) a = "0" + a;

    string res = "";
    int carry = 0;
    for (int i=a.size()-1; i>=0; --i) {
        int t = (a[i] - '0') + (b[i] - '0') + carry;
        res = toString(t % 10) + res;
        carry = t / 10;
    }
    if (carry) {
        res = "1" + res;
    }

    if (res.size() > 80) {
        return "overflow";
    }
    return res;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    string a, b;
    for (int i=0; i<n; ++i) {
        cin >> a >> b;
        cout << add(a, b) << endl;
    }
    return 0;
}

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

int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		string a, b;
		cin >> a >> b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		while(a.size() < 110) a += "0";
		while(b.size() < 110) b += "0";
		int carry = 0;
		string res = "";
		for(int i = 0; i< a.size(); i++) {
			res   += ((a[i] - '0') + (b[i] - '0') + carry) % 10 + '0';
			carry  = ((a[i] - '0') + (b[i] - '0') + carry) / 10;
		}
		while(res.size() > 1 && *(res.end()-1) == '0') res.erase(res.end()-1);
		reverse(res.begin(), res.end());
		cout << res << endl;
	}
}