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<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> sum(string A, string B);
int main() {
  int n;
  cin>>n;
  string a,b;
  for(int i=0;i<n;i++) {
    cin>>a;
    cin>>b;
    if((int)a.size()>80 || (int)b.size()>80)
      cout<<"overflow\n";
    else{
      vector<int> tmp=sum(a,b);
      if(tmp.size()>80)
	cout<<"overflow\n";
      else {
	string *s=new string[tmp.size()];
	for(int i=0;i<(int)tmp.size();i++) {
	  s[i]=to_string(tmp[i]);
	  cout<<s[i];
	}
	cout<<endl;
      }
    }
  }   
  return 0;
}
vector<int> sum(string A, string B) {
  int  a_size=A.size()-1;
  int  b_size=B.size()-1;
  int end=-1;
  vector<int> tmp;
  int Dr=0;
  while(true) {
    if(a_size<0 ){
      end=0;
      break;
    }
    if(b_size<0){
      end=1;
      break;
    }
    int a=(int)A[a_size]-(int)'0';
    int b=(int)B[b_size]-(int)'0';
    int n=a+b+Dr;
    if(n>=10){
      tmp.push_back(n-10);
      Dr=1;
    }
    else{
      Dr=0;
      tmp.push_back(n);
    }
    a_size--;
    b_size--;
  }

  if(end==0) {
    for(int i= b_size;i>=0;i--){
      int n=(int)B[b_size]-int('0')+Dr;
      if(n>=10) {
	tmp.push_back(n-10);
	Dr=1;
      }
      else{
	tmp.push_back(n);
	Dr=0;
      }
    }
  }
  else if(end==1){
    for(int i=a_size;i>=0;i--){
      int n=(int)A[a_size]-int('0')+Dr;
      if(n>=10){
	tmp.push_back(n-10);
	Dr=1;
      }
      else{
	tmp.push_back(n);
	Dr=0;
      }
    }
  }
  if(Dr==1)
    tmp.push_back(1);
  reverse(tmp.begin(),tmp.end());
  return tmp;
}

C++: #include<stdio.h>

int main(void)
{
	int x,y,n,m,sum;
	scanf("%d",&n);

	for(int t=0;t<n;t++)
	{
		scanf("%d",&x);
		scanf("%d",&y);

		sum=x+y;
		int keta;

		keta=sum/10;
		for(m=1;m<78;m++)
		{
			keta=keta/10;
		}

		if(keta>=0)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%d",sum);
		}
	}
	return 0;
}

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

int main(void)
{
    int N,j,k=0;
    cin >> N;
    char strA[100],strB[100];
    while(1){
        k++;
        if(k==N+1){
            break;
        }
        cin >> strA >> strB;
        int ans[81]={0};
        ans[0]=11111;
        if(strlen(strA)>80||strlen(strB)>80){
            cout << "overflow" << endl;
            continue;
        }
        int a[81]={0},b[81]={0};
        j=strlen(strA)-1;
        for(int i=80 ; j>=0 ; i--){
            a[i]=(int)strA[j]-48;
            j--;
        }
        j=strlen(strB)-1;
        for(int i=80 ; j>=0 ; i--){
            b[i]=(int)strB[j]-48;
            j--;
        }
        for(int i=80 ; i!=0 ; i--){
            ans[i]=ans[i]+a[i]+b[i];
            if(ans[i]>=10){
                ans[i]=ans[i]-10;
                ans[i-1]++;
            }
        }
        if(ans[0]!=11111){
            cout << "overflow" << endl;
            continue;
        }
        for(int i=1 ; i<81 ; i++){
            if(ans[i]!=0){
                j=i;
                break;
            }
        }
        char c[3];
        for(int i=j ; i<81 ; i++){
            printf("%c",ans[i]+48);
        }
        cout << '\n';
    }
    return 0;
}

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);
}