Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: import java.io.BufferedReader;
import java.io.InputStreamReader;

//©Èè¢B[vÉHvÌ]n è
//public class Problem0015_NationalBudget {
public class Main {
	public static void main(String[] args) {
		try {
		//	Problem0015_NationalBudget test = new Problem0015_NationalBudget();
			Main test = new Main();
			
			
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			int problemNumber = Integer.parseInt(reader.readLine());
			for(int i = 0; i < problemNumber; i++) {
				String origin = reader.readLine();
				String addition = reader.readLine();
				
				String result = test.getSum(origin, addition);
				if(result == null) {
					System.out.println("overflow");
				} else {
					System.out.println(result);
				}
			}
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	/*	Problem0015_NationalBudget test = new Problem0015_NationalBudget();
		for(int i = 0; i < 11; i++) {
			for(int j = 0; j < 11; j++) {
				String answer = test.getSum(Integer.toString(i), Integer.toString(j));
				if(i+j < 10) {
					if(answer.equals(Integer.toString(i+j))) {
						System.out.println(i + " + " + j + " = " + answer);
					} else {
						System.err.println(i + " + " + j + " = " + answer);
					}
				} else {
					if(answer == null) {
						System.out.println(i + " + " + j + " = " + "overflow");
					} else {
						System.err.println(i + " + " + j + " = " + answer);
					}
				}
			}
		}
	*/
	}
	String getSum(String origin, String addition) {
		final int CEILLING = 79;
		char[] originArray = origin.toCharArray();
		char[] additionArray = addition.toCharArray();
		
		char[] maxCharArray = (originArray.length < additionArray.length ? additionArray : originArray);
		char[] minCharArray = (originArray.length < additionArray.length ? originArray : additionArray);
		
		if(maxCharArray.length > CEILLING) {	//overflow ÌÆ«Í null ðÔ·B
			return null;
		}
		
		int[] resultNumberArray = new int[maxCharArray.length + 1];	//ªPÂãªéÂ\«ª éB
		int position;
		for(position = 1; position < minCharArray.length +1; position++) {
			int originNumber = Integer.parseInt("" + maxCharArray[maxCharArray.length - position]);
			int additionNumber = Integer.parseInt("" +minCharArray[minCharArray.length - position]);
			int sum = originNumber + additionNumber + resultNumberArray[resultNumberArray.length-position];
		//	System.out.println(maxCharArray[maxCharArray.length - position] + " + " + minCharArray[minCharArray.length - position] + " = " + sum);
			if(sum < 10) {
				resultNumberArray[resultNumberArray.length-position] = sum;
			} else {	//0<= sum < 19 æèJèãªèª"1"­¶
				sum = sum - 10;
				resultNumberArray[resultNumberArray.length-position] = sum;
				resultNumberArray[resultNumberArray.length-position -1] += 1;
			}
		}
		for(; position < maxCharArray.length + 1; position++) {
			int maxCharNumber = Integer.parseInt("" + maxCharArray[position - position]);
			int sum = resultNumberArray[resultNumberArray.length-position] + maxCharNumber;
			
			if(sum < 10) {
				resultNumberArray[resultNumberArray.length-position] = sum;
			} else {
				sum = sum - 10;
				resultNumberArray[resultNumberArray.length-position] = sum;
				resultNumberArray[resultNumberArray.length-position -1] += 1;
			}
		}
		if(resultNumberArray.length > CEILLING+1 ||(resultNumberArray.length == CEILLING+1 && resultNumberArray[0] > 0)) {
								//ªãªÁÄ80ð´¦½ê
			return null;
		}
		StringBuilder textBuilder = new StringBuilder();
		for(int number : resultNumberArray) {
			textBuilder.append(Integer.toString(number));
		}
		String result = textBuilder.toString();
		if(result.startsWith("0")) {
			result = result.substring(1);
		}
		return result;
	}
}

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

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main() {
  int n; cin >> n;
  while(n--) {
    string s1, s2; cin >> s1 >> s2;
      int m = max(s1.size(), s2.size());
      while(m != s1.size()) s1 = '0' + s1;
      while(m != s2.size()) s2 = '0' + s2;
      string ans;
      int c = 0;
      for(int i = m-1; i >= 0; i--) {
        int sum = s1[i]-'0' + s2[i]-'0' + c;
        c = sum/10;
        sum %= 10;
        ans += sum + '0';
      }
      if(c == 1) ans += '1';
      reverse(all(ans));
      if(ans.size() <= 80) cout << ans << endl;
      else cout << "overflow" << endl;
  }
}

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

string error = "overflow";

int main(){
	int n;
	cin >> n;
	bool over[n];
	int keta[n];
	string a[n], b[n];
	char c[n][81];
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 81; j++){
			c[i][j] = '0';
		}
	}
	for(int i = 0; i < n; i++){
		over[i] = false;
		keta[i] = 0;
		int extra = 0;
		cin >> a[i] >> b[i];
		if(a[i].size() < b[i].size()){
			swap(a[i],b[i]);
		}
		
		for(int j = 0; j < a[i].size(); j++){
			int p, q, num;
			stringstream sa, sb, sc;
			sa << a[i][a[i].size()-j-1];
			sa >> p;
			if(j < b[i].size()){
				sb << b[i][b[i].size()-j-1];
				sb >> q;
			}
			else{
				q = 0;
			}
			if(p+q+extra < 10){
				sc << p+q+extra;
				sc >> c[i][j];
				extra = 0;
			}
			else{
				int kurai;
				kurai = (p+q+extra)%10;
				sc << kurai;
				sc >> c[i][j];
				extra = 1;
				if(j == a[i].size()-1){
					c[i][a[i].size()] = '1';
					keta[i] = 1;
				}
			}
		}
		if(c[i][80] != '0'){
			over[i] = true;
		}
	}
	for(int i = 0; i < n; i++){
		if(over[i] == true){
			cout << error;
		}
		else{
			for(int j = 0; j < a[i].size()+keta[i]; j++){
			cout << c[i][a[i].size()+keta[i]-j-1];
			}
		}
		cout << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string a,b,out,tmp;
    cin >> a;
    cin >> b;
    //int m=max(a.size(),b.size());
    if(a.size()<b.size()){
      tmp=a;
      a=b;
      b=tmp;
    }
    //cout << a << endl;
    int si=-a.size()+b.size();
    for(int j=a.size()-1;j>=0;j--){
      if(j+si>=0){
	//cout << si << endl;
	a[j]+=b[j+si]-'0';
	//cout << a[j] << endl;
      }else{
	a[j]+=0;
	//cout << "!" << endl;
      }
      if(a[j]>'9'&&j!=0){
	a[j-1]++;
	a[j]-=10;
      }else if(a[j]>'9'&&j==0){
	a='1'+a;
	a[1]-=10;
	//for(int i=a.size();i>0;i--)
	//  a[i]=a[i-1];
	//a[1]-=10;
	//a[0]='1';
      }
    }
    cout << a << endl;
  }

}