Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

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

int n;
char a[256], b[256], c[256];	
int sz = 0;
int carry = 0;

int main()
{
        std::cin >> n;
	
	while( n-- ){
		memset( a, '0', 80 );
		memset( b, '0', 80 );
		
		std::cin >> a >> b;
		
		int maxlen = std::max( strlen( a ), strlen( b ) );
		
		if( maxlen > 80 ){
		 	std::cout << "overflow" << std::endl;
			continue;
		}
		
		std::reverse( a, a + strlen( a ) );
		std::reverse( b, b + strlen( b ) );
		
		a[strlen( a )] = '0';
		b[strlen( b )] = '0';
		
		for( int i = 0; i <= maxlen + 1; i++ ){
			int na = a[i] - '0' + carry;
			int nb = b[i] - '0';
			
			if( na + nb >= 10 ){
				na += nb - 10;
				carry = 1;
			}
			else{
				na += nb;
				carry = 0;
			}
			
			c[i] = na + '0';
		}
		
		sz = maxlen;
		
		if( c[sz] >= '1' && c[sz] <= '9' ){
		 	sz++;
		}
		
		if( sz >= 80 ){
		 	std::cout << "overflow" << std::endl;
		}
		else{
			std::reverse( c, c + sz );
			c[sz] = '\0';
			std::cout << c << std::endl;
		}
		sz = 0;
		carry = 0;
	}

 	return 0;
}

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

using namespace std;

int main(){
  int num;
  cin >> num;

  vector<int> LONGINT(num, 0);
  long long int larger; // 8?????????                                                        
  long long int smaller;        // 8?????????                                                

  int sum = 0;
  while(true){
    larger = 0;
    smaller = 0;
    for(int i=0;i<num;i++){
      cin >> LONGINT[i];
      // ???8???????????????.                                                                   
      smaller += (long long int)(LONGINT[i]%(int)pow(10.0, 8.0));
      larger += (long long int)(LONGINT[i]/(int)pow(10.0,8.0));
    }
    larger += smaller/pow(10,8);
    smaller = smaller%(int)pow(10,8);
    if(larger!=0){
      cout << larger << smaller << endl;
    }
  }
}

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

using namespace std;

int main()
{
	stringstream ss;
	string str;
	int n;
	long long num;
	
	cin >> n;
	while (n != 0){
		int sum = 0;
		for (int i = 0; i < 2; i++){
			cin >> str;
			ss.clear();
			ss.str("");
			ss << str;
			ss >> num;
			sum += num;
		}
		ss.clear();
		ss.str("");
		ss << sum;
		ss >> str;
		
		if (str.size() > 80){
				cout << "overflow" << endl;
				break;
		}
		else{
			cout << str << endl;
		}
		n--;
	}
	return (0);
}

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

string pls(string a,string b){
	string ret;
	reverse(a.begin(),a.end());
	reverse(b.begin(),b.end());
	if(a.size()<b.size())swap(a,b);
	while(a.size()!=b.size())b+='0';
	while(a.size()+1!=ret.size())ret+='0';
	for(int i=0;i < a.size(); i++){
		ret[i] = a[i] + b[i] + ret[i] - '0'*3;
		if(ret[i]>9){
			ret[i] = '0' + ret[i]%10;
			ret[i+1] = '1';
		}else{
			ret[i]= '0' + ret[i];
		}
	}
	
	reverse(ret.begin(),ret.end());
	if(~ret.find_first_not_of('0'))return ret.substr(ret.find_first_not_of('0'),ret.size()-ret.find_first_not_of('0'));
	else return "0";
}

int main(){
	string a,b;
	int n;
	
	cin >> n;
	while(n--){
		cin >> a >> b;
		if(pls(a,b).length()>80)cout << "overflow" << endl;
		else cout << pls(a,b) << endl;
	}
}

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

int n;
char a[85],b[85],answer[86];
char aa[85],bb[85];
int na=0,nb=0;

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		na=0,nb=0;
		//配列aa(bb)を'0'で初期化
		fill(aa,aa+85,'0');
		fill(bb,bb+85,'0');
		fill(a,a+85,0);
		fill(b,b+85,0);
		fill(answer,answer+85,0);
		scanf("%s%s",a,b);
		for(int i=0;a[i]!='\0';i++)
		{
			na++;
		}
		for(int i=0;b[i]!='\0';i++)
		{
			nb++;
		}
		//配列a(b)を右詰めでaa(bb)に収納する
		memcpy(aa+85-na,a,sizeof(char)*na);
		memcpy(bb+85-nb,b,sizeof(char)*nb);
		//以下足し算
		for(int j=84;j>=0;j--)
		{
			answer[j]+=aa[j]+bb[j]-'0';
			//繰り上げ
			if(answer[j]>'9')
			{
				answer[j-1]++;
				answer[j]-=10;
			}
		}
		int count=0;
		for(int j=0;(j<84)&&answer[j]=='0';j++)
		{
			count++;
		}
		if(count<5)
		{
			printf("overflow\n");
		}
		else
		{
		answer[85]='\0';//文字列終了のお知らせ
		memcpy(answer,answer+count,85-count+1);
		//出力
		printf("%s\n",answer);
		}
	}
}

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

int main(){
	string s1,s2;
	int num;
	cin>>num;
	for(int j=0;j<num;j++){
		cin>>s1;
		cin>>s2;
		int size1=s1.size();
		int size2=s2.size();
		if(size1>80 || size2>80){
			cout<<"overflow"<<endl;
			continue;
		}
		if(size1>size2){
			for(int a=0;a<(size1-size2);a++){
				s2='0'+s2;
			}
		}else if(size1<size2){
			for(int a=0;a<(size2-size1);a++){
				s1='0'+s1;
			}
		}
		string ans="";
		int plus=0;
		for(int i=size1-1;i>=-1;i--){
			if(i==-1){
				if(plus!=0){
					ans=(char)(plus+'0')+ans;
					continue;
				}else{
					continue;
				}
			}
			int alt=(s1[i]-'0')+(s2[i]-'0')+plus;
			if(alt>=10){
				ans=(char)(alt-10+'0')+ans;
				plus=alt/10;
			}else ans=(char)(alt+'0')+ans;
		}
		if(ans.size()>80){
			cout<<overflow<<endl;
		}else{
			cout<<ans<<endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
int main(void){
    int n,ap,bp,cp,t;
    char a[81],b[81],c[81];
    scanf("%d",&n);
    while(~scanf("%s%s",&a,&b)){
        ap=strlen(a);
        bp=strlen(b);
        cp=sizeof(c)-1;
        c[cp]='\0';
        t=0;
        while((t||ap||bp)&&cp>0){
            t+=(ap?a[--ap]-'0':0)+(bp?b[--bp]-'0':0);
            c[--cp]='0'+(t%10);
            t/=10;
        }
        if(t)puts("overflow");
        else puts("%s",&c[cp]);
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdlib>

using namespace std;

int main(){
	int N; cin >> N;
	for(int i = 0; i < N; i++){
		long double a, b;
		cin >> a >> b;
		if(log10(a + b) + 1 > 80){
			cout << "overflow" << endl; 
			return 0;
		}
		cout << a + b << endl;
	}
	return 0;
}