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 <stdio.h>
#include <string.h>

int main(void)
{
	int n, i, j, k, overflow, nonzero, a[1000] = {0}, b[1000] = {0}, sum[1000] = {0};
	char stra[1001], strb[1001];
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		overflow = 0;
		nonzero = 0;
		
		scanf("%s", stra);
		scanf("%s", strb);
		
		k = 0;
		for (j = strlen(stra) - 1; j >= 0; j--){
			a[k] = stra[j] - '0';
			k++;
		}
		
		k = 0;
		for (j = strlen(strb) - 1; j >= 0; j--){
			b[k] = strb[j] - '0';
			k++;
		}
		
		for (j = 0; j < 100; j++){
			sum[j] += a[j] + b[j];
			
			if (j > 79 && sum[j] != 0){
				printf("overflow\n");
				overflow = 1;
				break;
			}
			
			if (sum[j] > 9){
				sum[j+1]++;
				sum[j] -= 10;
			}
		}
		
		if (overflow == 0){
			for (j = 79; j >= 0; j--){
				if (nonzero == 0 && sum[j] != 0){
					nonzero = 1;
				}
				
				if (nonzero == 1){
					printf("%d", sum[j]);
				}
			}
			puts("");
		}
	}
	
	return (0);
}

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

int main(void)
{
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){

    int digits[2][80];
    for(j=0; j<2; ++j){
      for(k=0; k<80; ++k){
        digits[j][k] = 0;
      }
    }

    int overflow = 0; 

    for(j=0; j<2; ++j){
      char digit[81];
      scanf("%81s", digit);
      getchar();
      
      if(overflow || strlen(digit)>80){
        overflow = 1;
      }else{
        for(k=0; k<strlen(digit); ++k){
          digits[j][k] = digit[strlen(digit)-1-k]-'0';
        }
      }
    }

    if(!overflow){
      int sum[81];
      for(j=0; j<81; ++j){
        sum[j] = 0;
      }

      for(j=0; j<80; ++j){
        for(k=0; k<2; ++k){
          sum[j] += digits[k][j];
        }
        sum[j+1] += sum[j]/10;
        sum[j] %= 10;
      }

      if(sum[80]>0){
        overflow = 1;
      }else{
        int available = 0;
        for(j=80; j>=0; --j){
          if(available || sum[j]!=0 || j==0){
            available = 1;
            printf("%d", sum[j]);
          }
        }
        printf("\n");
      }
    }

    if(overflow){
      printf("overflow\n");
    }
  }

  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;
const int N = 80;

vector<int> makeDx(string str){
    reverse(str.begin(), str.end());
    vector<int> ret(N + 100, 0);
    REP(i, str.size()) ret[i] = str[i] - '0';
    return ret;
}

int main(){
    int n; cin >>n;
    REP(z, n){
        string str[2]; cin >>str[0] >>str[1];
        vector<int> dx[2] = {makeDx(str[0]), makeDx(str[1])};
        vector<int> ans(N + 100, 0);
        bool okflg = true;
        REP(i, N){
            int sum = dx[0][i] + dx[1][i];
            ans[i] += sum;
            if(i == N - 1 && ans[i] >= 10){
                cout <<"overflow" <<endl;
                okflg = false;
            }else if(ans[i] >= 10){
                ans[i + 1] = ans[i] / 10;
                ans[i] %= 10;
            }
        }

        if(okflg){
            reverse(ans.begin(), ans.end());
            int s = 0;
            while(ans[s] == 0 && s < (N + 100) - 1) s++;
            FOR(i, s, N + 100) cout <<ans[i];
            cout <<endl;
        }
    }
    return 0;
}

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

using namespace std;

int main(void)
{
	char a[256],b[256];
	int n,flag,count1,count2,count3,daisyo=0,miss=0;
	//n:aðßéñ flag:overflowÌmF count1:aÌ count2:bÌ count3:Ì· daisyo:aÆbÌå¬ÖW
	cin>>n;

	for (int i=0; i<n; i++) 
	{
		for(int i=0;i<256;i++){
			a[i]=0;
			b[i]=0;
		}
		flag=0;
		daisyo=0;
		miss=0;

		cin>>a>>b;
		count1= strlen(a);
		count2= strlen(b);
		
		if (count1>80||count2>80) {
			flag=1;
		}
		count3=count1-count2;//Ì·
		
		if(count2>count1)
		{
			count3*=-1;//Ì·ðC³
			daisyo=1;
		}
		
		if(daisyo==0)//ªa>bÌê
		{
			if(!(count1==count2))
			for(int j=0;j<=count2;j++)
			{
				b[count2-j+count3]=b[count2-j];//bÌðaÉí¹éæ¤C³
			}
			for (int j=0; j<count3; j++) {
				b[j]='0';
			}
			
			for (int j=1; j<=count1; j++) {
				a[count1-j]+=b[count1-j]-48;
				if (((int)a[count1-j])-48>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					a[count1-j]=(a[count1-j]-48)%10+48;
					if ((count1-j)==0) {
						miss=1;
					}
					else {
							a[count1-j-1]=a[count1-j-1]+1;

						
					}
				}
			}
		}
		
		else //ªb>aÌê
		{
			for(int j=0;j<=count1;j++)
			{
				a[count1-j+count3]=a[count1-j];//bÌðaÉí¹éæ¤C³
			}
			for (int j=0; j<count3; j++) {
				a[j]='0';
			}
			
			for (int j=1; j<=count2; j++) {
				b[count2-j]+=a[count2-j]-48;
				if (((int)b[count2-j]-48)>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					b[count2-j]=(b[count2-j]-48)%10+48;
					if ((count2-j)==0) {
						miss=1;
					}
					else {
						b[count2-j-1]=b[count2-j-1]+1;
					}
				}
			}
		}
		
		if(flag==1)
		{
			cout << "overflow" << endl;
		}
		
		else 
		{
			if (miss==1) {
				cout << '1';
			}
			if(daisyo==0) 
			{
				for (int j=0; j<count1; j++) 
				{
					cout << (int)a[j]-48;
				}
			}
			
			else 
			{
				for (int j=0; j<count2; j++) 
				{
					cout << (int)b[j]-48;
				}
			}
			cout << endl;

		}
		
		
	}
		
		
	
	return (0);
}

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

int main(){
	string a, b;
	vector<int> ans;
	int n, num, ai, bi, c=0;
	bool flag;

	cin >> n;
	
	for(int i=0 ; i<n ; i++){
		cin >> a >> b;
		flag = false;
		
		for(int j=0 ; j<100 ; j++){
			num = 0;
			ai = a.size()-j-1;
			bi = b.size()-j-1;
			if( ai<0 && bi<0 && c==0) break;
			
			if(ai>=0)num += a[ ai ] - 48;
			if(bi>=0)num += b[ bi ] - 48;
			ans.push_back( (num+c)%10 );
			if(num+c >= 10) c = 1;
			else c = 0;
		}
		if(ans.size()>80){
			flag = true;
		}
		if(flag){
			printf("overflow");
		}else{
			for(int j=ans.size()-1 ; j>=0 ; --j){
				printf("%d", ans[j]);
			}
		}
		printf("\n");
		ans.clear();
	}
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
int max(int a,int b){return a>b?a:b;}
int main(){
	int n,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		char a[81];
		char b[81];
		char x[81];
		char y[81];
		char ans[82];
		scanf(" %s",a);
		scanf(" %s",b);
		for(j=0;j<80;j++){
			x[j]='0';
			y[j]='0';
		}
		x[80]='\0';
		y[80]='\0';
		for(j=0;j<strlen(a);j++)x[79-j]=a[strlen(a)-1-j];
		for(j=0;j<strlen(b);j++)y[79-j]=b[strlen(b)-1-j];
		int k=0;
		for(j=80;j>=1;j--){
			int p=0;
			p+=k;
			p+=(x[j-1]-'0')+(y[j-1]-'0');
			k=p/10;
			ans[j]=p%10+'0';
		}
		ans[0]='0';
		ans[81]='\0';
		j=0;
		while(j<=81&&ans[j]=='0')j++;
		if(k!=0)printf("overflow\n");
		else if(j==81)printf("0\n");
		else{
			for(;j<81;j++){
				printf("%c",ans[j]);
			}
			printf("\n");
		}
	}
	return 0;
}