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 <string>
#include <list>
using namespace std;

class bigdata
{
public:
  list < int >data;
  string to_str ()
  {
    string str (data.size (), '0');
    int i = 0;
    auto it = data.begin ();
    while (it != data.end ())
      {
	string buf = to_string (*it);
	  str[i] = buf[0];
	  it++;
	  i++;
      }
    return str;
  }
  bigdata & operator= (string str)
  {
    for (int i = 0; i < str.length (); i++)
      data.push_back (stoi (str.substr (i, 1)));
  }
  bigdata & operator+ (bigdata & obj)
  {
    if (this->data.size () < obj.data.size ())
      {
	int buf = obj.data.size () - this->data.size ();
	for (int i = 1; i <= buf; i++)
	  this->data.push_front (0);
      }
    if (this->data.size () > obj.data.size ())
      {
	int buf = this->data.size () - obj.data.size ();
	for (int i = 1; i <= buf; i++)
	  obj.data.push_front (0);
      }
    this->data.push_front (0);
    obj.data.push_front (0);

    auto it_a = this->data.begin ();
    auto it_b = obj.data.begin ();

    while (it_a != this->data.end ())
      {
	*it_a += *it_b;
	auto bufit = it_a;
	for (int i = 0; i < this->data.size () - 1; i++)
	  {
	    if (*bufit >= 10)
	      {
		bufit--;
		*bufit += 1;
		++bufit;
		*bufit -= 10;
		bufit--;
	      }
	  }
	it_a++;
	it_b++;
      }
    it_a = this->data.begin ();
    if (*it_a == 0)
      this->data.pop_front ();
    return *this;
  }
};

int
main ()
{
  string s1, s2;
  int loop;
  cin >> loop;
  while (loop-- > 0)
    {
      cin >> s1 >> s2;
      bigdata data1, data2;
      data1 = s1;
      data2 = s2;
      data1 = data1 + data2;
      if ((data1.to_str().length()) > 80)
	cout << "overflow" << endl;
      else
	cout << data1.to_str () << endl;
    }
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include<string.h>
#include <utility>
using namespace std;
int main(){
	int m;
	string in,in2;
	int a[1000],b[1000],ans[1000];
	int f;
	int alen,blen,mlen;
	cin>>m;
	while(m--){
		for(int i=0;i<90;i++){
			a[i]=b[i]=ans[i]=0;
		}
		cin>>in;
		cin>>in2;
		alen=in.size();
		blen=in2.size();
		for(int i=0;i<alen;i++){
			a[alen-1-i]=in[i]-'0';
		}
		for(int i=0;i<blen;i++){
			b[blen-1-i]=in[i]-'0';
		}
		mlen=max(alen,blen);
		if(mlen>80){
			cout<<"overflow"<<endl;
			continue;
		}
		f=0;
		for(int i=0;i<mlen+1;i++){
			ans[i]=(a[i]+b[i]+f)%10;
			f=(a[i]+b[i]+f)/10;
		}
		if(ans[mlen]!=0){
			//if(mlen>79){
				//cout<<"overflow"<<endl;
				//continue;
			//}
			//cout<<ans[mlen];
		}
		
		for(int i=0;i<mlen;i++){
			cout<<ans[mlen-1-i];
		}cout<<endl;
		
		
	}
	return 0;
}

C++: #include <stdio.h>

#define BUF_SIZE 256

int main(void) {
	char buf[BUF_SIZE];
	int num1[81];
	int num2[81];
	int sum[81];
	char str[82];
	int n;
	int i, j, k;
	
	fgets(buf, sizeof(buf), stdin);
	sscanf(buf, "%d", &n);
	
	for (i=0; i<n; i++) {
		for (j=0; j<81; j++) {
			num1[j] = num2[j] = 0;
		}
		for (j=0; j<81; j++) {
			sum[j]=0;
		}		
		
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		j=k=0;
		while (str[j] != '\0')  j++;
		while (--j >= 0) num1[k++] = (int)(str[j] - '0'); 
		
		fgets(buf, sizeof(buf), stdin);
		sscanf(buf, "%s", &str);
		j=k=0;
		while (str[j] != '\0')  j++;
		while (--j >= 0) num2[k++] = (int)(str[j] - '0'); 
		
		for (j=0; j<80; j++) {
			sum[j] += num1[j]+num2[j];
			if (sum[j] >= 10) {
				sum[j+1] += 1;
				sum[j] = sum[j]%10;
			}
		}
		
		if (sum[80] != 0) {
			printf("overflow\n");
		}
		else {
			j=79;
			while (sum[j] == 0)  j--;
			for (; j>=0; j--) {
				printf("%d", sum[j]);
			}
			printf("\n");
		}
	}
	
	return 0;
}