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 <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] = ' ';
		}
	}
	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]);
		}
		if(a[i].size() > 80){
			over[i] = true;
			continue;
		}
		
		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];
			sb << b[i][b[i].size()-j-1];
			sa >> p;
			sb >> q;
			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] != ' '){
			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 <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#define MAX_LEN 101

using namespace std;

void q15() {
	int N;
	scanf("%d\n", &N);
	for (int n = 0; n < N; n++) {
		string a, b;
		getline(cin, a);
		getline(cin, b);

		if (a.length() < b.length()) {
			string tmp = a;
			a = b;
			b = tmp;
		}

		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		
		int carry = 0;
		string ans="";

		int i = 0;
		for (; i < b.length(); i++) {
			ans+= (((a[i] - '0') + (b[i] - '0') + carry) % 10) + '0';
			carry = ((a[i] - '0') + (b[i] - '0') + carry) / 10;
		}
		for (; i < a.length(); i++) {
			ans+= (((a[i] - '0') + carry) % 10) + '0';
			carry = ((a[i] - '0') + carry) / 10;
		}
		for (; carry; i++) {
			ans+= (carry % 10) + '0';
			carry = carry / 10;
		}

		reverse(ans.begin(), ans.end());
		cout << (ans.length() > 80 ? "overflow" : ans) << endl;
	}
}
int main() {
	q15();
	return 0;
}

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

int n;
char a[256], b[256], c[256];	
int sz = 0;
int carry = 0;

int main()
{
        std::cin >> n;
	
	while( n-- ){
		memset( a, '0', 80 );
		memset( b, '0', 80 );
		
		std::cin >> a >> b;
		
		int maxlen = std::max( strlen( a ), strlen( b ) );
		
		if( maxlen > 80 ){
		 	std::cout << "overflow" << std::endl;
			continue;
		}
		
		std::reverse( a, a + strlen( a ) );
		std::reverse( b, b + strlen( b ) );
		
		a[strlen( a )] = '0';
		b[strlen( b )] = '0';
		
		for( int i = 0; i <= maxlen + 1; i++ ){
			int na = a[i] - '0' + carry;
			int nb = b[i] - '0';
			
			if( na + nb >= 10 ){
				na += nb - 10;
				carry = 1;
			}
			else{
				na += nb;
				carry = 0;
			}
			
			c[i] = na + '0';
		}
		
		sz = maxlen;
		
		if( c[sz] >= '1' && c[sz] <= '9' ){
		 	sz++;
		}
		
		if( sz >= 80 ){
		 	std::cout << "overflow" << std::endl;
		}
		else{
			std::reverse( c, c + sz );
			c[sz] = '\0';
			std::cout << c << std::endl;
		}
		sz = 0;
		carry = 0;
	}

 	return 0;
}

C++: include <iostream>
#include <cmath>
#include <vector>

using namespace std;

int main(){
  int num;
  cin >> num;

  vector<int> LONGINT(num, 0);
  long long int larger; // 8?????????                                                        
  long long int smaller;        // 8?????????                                                

  int sum = 0;
  while(true){
    larger = 0;
    smaller = 0;
    for(int i=0;i<num;i++){
      cin >> LONGINT[i];
      // ???8???????????????.                                                                   
      smaller += (long long int)(LONGINT[i]%(int)pow(10.0, 8.0));
      larger += (long long int)(LONGINT[i]/(int)pow(10.0,8.0));
    }
    larger += smaller/pow(10,8);
    smaller = smaller%(int)pow(10,8);
    if(larger!=0){
      cout << larger << smaller << endl;
    }
  }
}

C++: #include <iostream>
#include <sstream>
#include <cstring>

using namespace std;

int main()
{
	stringstream ss;
	string str;
	int n;
	long long num;
	
	cin >> n;
	while (n != 0){
		int sum = 0;
		for (int i = 0; i < 2; i++){
			cin >> str;
			ss.clear();
			ss.str("");
			ss << str;
			ss >> num;
			sum += num;
		}
		ss.clear();
		ss.str("");
		ss << sum;
		ss >> str;
		
		if (str.size() > 80){
				cout << "overflow" << endl;
				break;
		}
		else{
			cout << str << endl;
		}
		n--;
	}
	return (0);
}