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++: /*
 * Problem     : AOJ0015
 * Title       : Integral
 * Author      : mizo0203
 * Status      : Accepted
 * Date        : Sun Jun 24 20:50:52
 * Copyright   : Your copyright free
 * Description : 文字列・多倍長演算
 */

#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

int N, f;
char str1[81], str2[81];
int sum[80];

void init() {
  scanf("%d", &N);
}

bool input() {
  char c;

  if (!N)
    return false;
  N--;

  f = 0;
  scanf("%80s", str1);
  scanf("%c", &c);
  if (c != '\n') {
    f = 1;
    return true;
  }
  scanf("%80s", str2);
  scanf("%c", &c);
  if (c != '\n') {
    f = 1;
    return true;
  }

  return true;
}

int main() {
  int i;

  init();
  while (input()) {
    if (f) {
      printf("overflow\n");
      continue;
    }
    fill(sum, sum + 80, 0);
    for (i = 0; i < (int) strlen(str1); i++) {
      sum[i] = str1[strlen(str1) - i - 1] - '0';
    }
    f = 0;
    for (i = 0; i < (int) strlen(str2); i++) {
      sum[i] += str2[strlen(str2) - i - 1] - '0' + f;
      f = 0;
      if (sum[i] > 9) {
        sum[i] -= 10;
        f = 1;
      }
    }
    for (; i < 80; i++) {
      sum[i] += f;
      f = 0;
      if (sum[i] > 9) {
        sum[i] -= 10;
        f = 1;
      }
    }
    if (f) {
      printf("overflow\n");
      continue;
    }
    for (i = 0; i < 79; i++) {
      if (sum[79 - i] != 0)
        break;
    }
    for (; i < 80; i++) {
      printf("%d", sum[79 - i]);
    }
    printf("\n");
  }

  return 0;
}

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

int main()
{
	string s1, s2, temp;
	int sum, flag;
	int a, b;
	vector<int> v;
	int T;
	cin >> T;
	while (T--)
	{
		cin >> s1 >> s2;
		v.clear();
		sum = 0;
		flag = 0;
		reverse(s1.begin(), s1.end());
		reverse(s2.begin(), s2.end());
		if (s1.size() < s2.size())
		{
			temp = s1;
			s1 = s2;
			s2 = temp;
		}
		for (int i = 0; i < s1.size(); ++i)
		{
			if (s1[i] == '0')a = 0;
			else if (s1[i] == '1')a = 1;
			else if (s1[i] == '2')a = 2;
			else if (s1[i] == '3')a = 3;
			else if (s1[i] == '4')a = 4;
			else if (s1[i] == '5')a = 5;
			else if (s1[i] == '6')a = 6;
			else if (s1[i] == '7')a = 7;
			else if (s1[i] == '8')a = 8;
			else if (s1[i] == '9')a = 9;
			if (i >= s2.size())b = 0;
			else
			{
				if (s2[i] == '0')b = 0;
				else if (s2[i] == '1')b = 1;
				else if (s2[i] == '2')b = 2;
				else if (s2[i] == '3')b = 3;
				else if (s2[i] == '4')b = 4;
				else if (s2[i] == '5')b = 5;
				else if (s2[i] == '6')b = 6;
				else if (s2[i] == '7')b = 7;
				else if (s2[i] == '8')b = 8;
				else if (s2[i] == '9')b = 9;
			}
			sum = a + b + flag;
			if (sum > 9)
			{
				sum = sum - 10;
				flag = 1;
			}
			else
			{
				flag = 0;
			}
			v.push_back(sum);
		}
		if (flag == 1)
			v.push_back(1);
		if (v.size() > 80)
			cout << "overflow" << endl;
		else
		{
			for (int i = v.size() - 1; i >= 0; --i)
			{
				cout << v[i];
			}
			cout << endl;
		}
	}
	return 0;
}

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

int count(int data[]){
	int cnt = 0,i=0;
	while(1){
		if(data[i] == 10)break;
		cnt++;
		i++;
	}
	return cnt;
}

void sum(char data1[],char data2[],int ans[]){
	int i;
	for(i = 0;i < strlen(data1) || i < strlen(data2);i++){
		int st1,st2,st3;
		if(i >= strlen(data1)){
			st1 = 0;
		}else{
			st1 = data1[strlen(data1)-i-1];
			st1 = st1 - 48;
		}
		if(i >= strlen(data2)){
			st2 = 0;
		}else{
			st2 = data2[strlen(data2)-i-1];
			st2 = st2 - 48;
		}
		st3 = st1 + st2;
		if(st3 >= 10){
			if(ans[i] == 1){
				ans[i] = st3 - 9;
				ans[i + 1] = 1;
			}else{
				ans[i] = st3 - 10;
				ans[i + 1] = 1;
			}
		}else{
			if(ans[i] == 1){
				if(st3 == 9){
					ans[i] = 0;
					ans[i + 1] = 1;
				}else{
					ans[i] = st3 + 1;
				}
			}else{
				ans[i] = st3;
			}
		}
	}
	if(ans[i] == 1){
		ans[i + 1] = 10;
	}else{
		ans[i] = 10;
	}
}

int main(void){
	int cnt,i;
	scanf("%d",&cnt);
	for(i = 0;i < cnt;i++){
		int ans[82];
		char data1[82],data2[82];
		scanf(" %80s",data1);
		fflush(stdin);
		scanf(" %80s",data2);
		fflush(stdin);
		if(strlen(data1) > 80 || strlen(data2) > 80){
			printf("overflow\n");
		}else{
			sum(data1,data2,ans);
			if(count(ans) >= 80){
				printf("overflow\n");
			}else{
				int j;
				for(j = count(ans)-1;j >= 0;j--){
					printf("%d",ans[j]);
				}
				printf("\n");
			}
		}
	}
	return 0;
}