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 <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	int n;
	cin >> n;
	for(int j=0;j<n;j++)
	{
		string s1,s2;
		vector<int> ans;
		cin >> s1;
		cin >> s2;
		reverse(s1.begin(),s1.end());
		reverse(s2.begin(),s2.end());
		int k=0;
		int p=max(s1.size(),s2.size());
		int len1=s1.size(),len2=s2.size();
		s1.resize(p+2);
		s2.resize(p+2);
		for(int i=len1;i<p+2;i++)
		{
			s1[i]='0';
		}
		for(int i=len2;i<p+2;i++)
		{
			s2[i]='0';
		}
		ans.resize(p+2);
		for(int i=0;i<p+2;i++)
		{
			ans[i]=((s1[i]-'0')+(s2[i]-'0')+k)%10;
			if((s1[i]-'0')+(s2[i]-'0')+k>=10)k=1;
			else k=0;
		}
		vector<int>::iterator it=ans.end();
		it--;
		int r=0;
		while(*it==0)
		{
			ans.erase(it);
			r++;
			it--;
		}
		ans.resize(p+2-r);
		reverse(ans.begin(),ans.end());
		if(ans.size()>80)
		{
			printf("overflow\n");
			continue;
		}
		for(int i=0;i<ans.size();i++)
		{
			cout << ans[i];
		}
		cout << endl;
	}
	return 0;
}

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

using namespace std;


int main(){
	char buf1[101],buf2[101];
	bool FLG1,FLG2;
	int n,length1,length2,S1,S2,num1_index,num2_index,kuriagari=0,check1,check2;
	int output[9],num1[9],num2[9];
	scanf("%d",&n);

	for(int loop=0;loop<n;loop++){
		length1 = length2 = 0;
		scanf("%s",buf1);
		scanf("%s",buf2);
		for(int i=0; buf1[i] !='\0';i++)length1++;
		for(int i=0; buf2[i] !='\0';i++)length2++;

		if(length1 >=81 || length2 >= 81)printf("overflow\n");
		else{
			FLG1=FLG2=false;
			num1_index = num2_index = 0;
			for(int k=0;k<9;k++){
				num1[k] = num2[k] = output[k]=-1;//????????¨??????????????????
			}

			for(int k=0;k<80&&(FLG1==false||FLG2==false);){
				S1=S2=0;
				check1=check2=0;
				for(int p=0;p<9&&k<80;p++,k++){
					if(k <= length1-1){
						S1 = 10*S1 + (buf1[k] - '0');
						check1++;
					}else{
						FLG1=true; //??????
					}

					if(k <= length2-1){
						S2 = 10*S2+(buf2[k] - '0');
						check2++;
					}else{
						FLG2=true; //??????
					}
				}
				if(check1>0){
					num1[num1_index++] = S1;
				}
				if(check2>0){
					num2[num2_index++] = S2;
				}
			}

			for(int calc=0;calc<=8;calc++){
				if(num1[calc] == -1 && num2[calc] == -1){
					if(kuriagari != 0){
						output[calc] = kuriagari;
					}
					break;
				}else{
					output[calc] = kuriagari;
					if(num1[calc] != -1){
						output[calc] += num1[calc];
					}
					if(num2[calc] != -1){
						output[calc] += num2[calc];
					}
					if(output[calc]/1000000000 >= 1){
						kuriagari = output[calc]/1000000000;
						output[calc] %= 1000000000;
					}else{
						kuriagari = 0;
					}
				}
			}

			if(output[8]/100000000 >= 1){
				printf("overflow\n");
			}else{
				bool firstFLG=true;
				for(int show=8;show>=0;show--){
					if(output[show] != -1){
						if(firstFLG == false && output[show] < 100000000){
							printf("%09d",output[show]);
						}else{
							printf("%d",output[show]);
							firstFLG = false;
						}
					}
				}
				printf("\n");
			}
		}
	}

    return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
using namespace std;
int main(void)
{
	int y;
	scanf("%d",&y);
	for(int z = 0;z < y;z++)
	{
		char suji1[100000],suji2[100000];
		char ans[100000] = {0};

		for(int i = 0;i<82;i++)
		{
			suji1[i] = '0';
			suji2[i] ='0';
		}

		int overflow = 0;

		scanf("%s",suji1);
		scanf("%s",suji2);
		int suji1s = strlen(suji1);
		int suji2s = strlen(suji2);

		int anss;
		if(suji1s>suji2s)  anss = suji1s;
		else anss = suji2s;

		suji1[suji1s] = '0';
		suji2[suji2s] = '0';

		reverse(suji1,suji1+suji1s);
		reverse(suji2,suji2+suji2s);

		for(int i = 0;i < 80;i++)
		{
			ans[i] = suji1[i]+suji2[i] - '0';
			if(ans[i] >= ':')
			{
				ans[i]  = ans[i] - 10;
				suji2[i+1] = suji2[i+1]+1;
			}
		}
		
		if(ans[anss]!= '0') anss++;
		if(anss >=81) overflow = 1;
		reverse(ans,ans+anss);
		ans[anss] = 0;
		if(overflow >= 1)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%s\n",ans);
		}
		
	}
	return 0;
}