Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var n int
        var a, b string
        sc := bufio.NewScanner(os.Stdin)
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                sc.Scan()
                a = sc.Text()
                sc.Scan()
                b = sc.Text()

                if len(a) > len(b) {
                        s := add(a, b)
                        if s[len(a)] > 0 {
                                if len(a) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(a)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(a);i++ {
                                                fmt.Printf("%d", s[len(a)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                } else {
                        s := add(b, a)
                        if s[len(b)] > 0 {
                                if len(b) >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i <= len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i])
                                        }
                                }
                                fmt.Printf("\n")
                        } else {
                                if len(b)-1 >= 80 {
                                        fmt.Printf("overflow")
                                } else {
                                        for i := 0; i < len(b);i++ {
                                                fmt.Printf("%d", s[len(b)-i-1])
                                        }
                                }
                                fmt.Printf("\n")
                        }
                }
        }
}

// expects ln > lm
func add(n string, m string) (s [100]int) {
        ln := len(n)
        lm := len(m)
        var sum [100]int

        for i := 0; i < ln; i++ {
                var s, t int
                s = int(n[ln-1-i]) - int('0')

                if lm - 1 - i >= 0 {
                        t = int(m[lm-1-i]) - int('0')
                } else {
                        t = 0
                }

                sum[i+1] = (s + t + sum[i]) / 10
                sum[i] = (s + t + sum[i]) % 10
        }

        return sum
}

C++: #include<cstdio>
#include<algorithm>
#include<string.h>
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>
using namespace std;

string calc(string s1,string s2){
  int num1=s1.size()-1,num2=s2.size()-1;
  int tmp=0;
  string s;
  while(!(num1==-1&&num2==-1&&tmp==0)){
    if(num1!=-1&&num2!=-1){
      tmp+=int(s1[num1]-'0')+int(s2[num2]-'0');
      num1--;num2--;
    }else if(num1!=-1&&num2==-1){
      tmp+=int(s1[num1]-'0');
      num1--;
    }else if(num1==-1&&num2!=-1){
      tmp+=int(s2[num1]-'0');
      num2--;
    }
    s=to_string(tmp%10)+s;
    tmp/=10;
  }
  if(s.size()>80)s="overflow";
  return s;
}

int main(){
  cin.tie(0);ios::sync_with_stdio(false);
  int n;
  string s1,s2;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s1>>s2;
    cout<<calc(s1,s2)<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	while(N--){
		string a,b;
		cin >> a >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while(a.size()>b.size())b += '0';
		while(a.size()<b.size())a += '0';
		string r;
		int c = 0; 
			for(int i = 0 ; i < a.size() ; i++){
			int d = a[i] + b[i] + c - 2 * '0';
			if( d >= 10 ) c = 1;
			r += d%10 + '0';
		}
		if(c)r += '0' + c;
		reverse(r.begin(),r.end());
		if( a.size() > 80 or b.size() > 80 or r.size() > 80 ) cout << "overflow" << endl;
		else cout << r << endl;
	}
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    for(int j=0;j<n;j++){
        string a,b;
        cin>>a>>b;
        int numa[100000]={0},numb[100000]={0};
        int flag=0;
        int sum[81]={0};
        if(80<max(a.size(),b.size())){
            puts("overflow");
            goto exit;
        }
        for(int i=a.size()-1,k=0;0<=i;i--,k++)numa[k]=a[i]-'0';
        for(int i=b.size()-1,k=0;0<=i;i--,k++)numb[k]=b[i]-'0';
        for(int i=0;i<max(a.size(),b.size());i++){
            sum[i]+=(numa[i]+numb[i]);
            sum[i+1]=sum[i]/10,sum[i]=sum[i]%10;
            if(sum[80]!=0){
                puts("overflow");
                goto exit;
            }
        }
        for(int i=80;0<=i;i--){
            if(flag==1||sum[i]!=0)flag=1;
            if(flag==1)printf("%d",sum[i]);
        }
        puts("");
exit:
;
        /*
        for(int i=0;i<80;i++)printf("%d",numa[i]);
        puts("");
        for(int i=0;i<80;i++)printf("%d",numb[i]);
        puts("");
        for(int i=0;i<80;i++)printf("%d",sum[i]);
        puts("");
        */
    }
    return 0;
}

C++: #include <iostream>
#include <iostream>
#include <vector>
using namespace std;
string add(string a,string b){

  int numa[1001] = {0},numb[1001] = {0};

  for(int i = a.size()-1 ; i >= 0 ; i-- )numa[a.size()-i-1] = a[i]-'0';
  for(int i = b.size()-1 ; i >= 0 ; i-- )numb[b.size()-i-1] = b[i]-'0';

  vector<int> renum(1001);

  fill(renum.begin(),renum.end(),0);
  int mxsize = max(a.size(),b.size());

  for(int i = 0 ; i < mxsize ; i++ ){
    renum[i+1] = (renum[i] + numa[i] + numb[i])/10;
    renum[i] = (renum[i] + numa[i] + numb[i])%10;
  }

  string srenum = "";
  for(int i = mxsize ; i >= 0 ; i-- ){
    if(i == mxsize && renum[i] == 0)continue;
    srenum += renum[i]+'0';
  }
  return srenum;
}

int main(){
  int n;
  cin >> n;
  while(n--){
    string a,b;
    cin >> a >> b;
    a = add(a,b);
    if(a.size() > 80)cout << "overflow" << endl;
    else cout << a << endl;
  }
  return 0;
}