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 <algorithm>

const int MAX_SIZE = 90;

#define toI(x) (x-'0')

using namespace std;

class Z
{
private:
  int size;
  char d[MAX_SIZE];
public:
  Z(char *s)
  {
    size = strlen(s);
    for(int i=0;i<MAX_SIZE - size;i++)
      d[i] = 0;
    for(int i=0,j=MAX_SIZE - size;j < MAX_SIZE; i++, j++)
      d[j] = s[i];
  }

  void add(Z r)
  {
    int tmp = max(this->size, r.size);
    int updigit = 0;
    for(int i=MAX_SIZE-1;i>=0;i--){
      int a = 0, b = 0;
      if(this->d[i] == 0&& r.d[i] == 0){
	if(!updigit)
	  goto end;
	this->d[i] = updigit+'0';
	updigit = 0;
	tmp++;
      }else{
	if(this->d[i])
	  a = toI(this->d[i]);
	if(r.d[i])
	  b = toI(r.d[i]);
	int n = a + b + updigit;
	updigit = n / 10;
	this->d[i] = (n % 10)+'0';
      }
    }
  end:
    this->size = tmp;
    return;
  }

  void print()
  {
    if(this->size > 80){
      puts("overflow");
      return;
    }
    for(int i=0;i<MAX_SIZE;i++)
      if(d[i] != -1)
	putchar(d[i]);
    puts("");
  }

  int sz()
  {
    return this->size;
  }
};

int main()
{
  int x;
  scanf("%d", &x);
  char s1[1000], s2[1000];  
  for(int i=0;i<x;i++){
    scanf("%s %s",s1, s2);
    if(strlen(s1) > 80 || strlen(s2) > 80){
      puts("overflow");
      continue;
    }
    Z z1(s1);
    Z z2(s2);
    z1.add(z2);
    z1.print();
  }
  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[100];
		char b[100];
		char x[100];
		char y[100];
		char ans[100];
		scanf(" %s",a);
		scanf(" %s",b);
		for(j=0;j<99;j++){
			x[j]='0';
			y[j]='0';
		}
		x[99]='\0';
		y[99]='\0';
		for(j=0;j<strlen(a);j++)x[98-j]=a[strlen(a)-1-j];
		for(j=0;j<strlen(b);j++)y[98-j]=b[strlen(b)-1-j];
		int k=0;
		for(j=98;j>=1;j--){
			int p=0;
			p+=k;
			p+=(x[j]-'0')+(y[j]-'0');
			k=p/10;
			ans[j]=p%10+'0';
		}
		ans[0]='0';
		ans[99]='\0';
		j=0;
		while(j<=99&&ans[j]=='0')j++;
		if(j<=18)printf("overflow\n");
		else if(j==99)printf("0\n");
		else{
			for(;j<99;j++){
				printf("%c",ans[j]);
			}
			printf("\n");
		}
	}
	return 0;
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main(){
    string inp[2];
    int output[81],n;
    cin >> n;
    while(n--){
        cin >> inp[0] >> inp[1];
        if(inp[0].size()>80||inp[0].size()>80) cout << "overflow" << endl;
        else{
            fill(output,output+81,0);
            reverse(inp[0].begin(),inp[0].end());
            reverse(inp[1].begin(),inp[1].end());
            for(int i=0;i<81;i++){
                if(i<inp[0].size()) output[i]+=inp[0][i]-'0';
                if(i<inp[1].size()) output[i]+=inp[1][i]-'0';
                if(i!=80&&output[i]>9){
                    output[i+1]+=output[i]/10;
                    output[i]%=10;
                }
            }
            if(output[80]>0) cout << "overflow" << endl;
            else{
                bool flag=false;
                for(int i=79;i>=0;i--){
                    if((!flag&&output[i]!=0)||i==0) flag=true;
                    if(flag) cout << output[i];
                }
                cout << endl;
            }
        }
    }
    return 0;
}

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

int main() {
	int dsn; scanf("%d", &dsn);
	for(int dsi = 0; dsi < dsn; dsi++) {
		static char ais[90],bis[90];
		scanf(" %90s %90s",ais,bis);
		int aislen = strlen(ais);
		int bislen = strlen(bis);
		static int ad[90],bd[90];
		fill(ad,ad+90,0);
		fill(bd,bd+90,0);
		for(int i = 0; i < aislen; i++) ad[i] = ais[aislen-1-i]-'0';
		for(int i = 0; i < bislen; i++) bd[i] = bis[bislen-1-i]-'0';
		int cl = 0;
		for(int i = 0; i < 90; i++) {
			ad[i] += bd[i]+cl;
			cl = ad[i]/10;
			ad[i] %= 10;
		}
		bool flag = false;
		for(int i = 89; i >= 0; i--) {
			flag = flag || ad[i];
			if(flag) {
				printf("%d",ad[i]);
			}
		}
		if(!flag)printf("0");
		printf("\n");
	}
	return 0;
}