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++: #include <bits/stdc++.h>

using namespace std;

int main(){
        int N;
        cin>>N;
        for (int i = 0; i < N; i++) {
                string a,b,c,d;
                cin>>a;
                cin>>b;
                int x=max(a.length(),b.length());
                for (int j = 0; j < x-a.length()+1; j++) {
                        c+="0";
                }
                for (int j = 0; j < x-b.length()+1; j++) {
                        d+="0";
                }
                c+=a;
                d+=b;
                for (int j = 0; j < x+1; j++) {
                        c[j]+=d[j]-'0';
                }
                for (int j = x; j >= 0; j--) {
                        if(c[j]>'9'){
                                c[j]-=10;
                                c[j-1]++;
                        }
                }

                if(c[0]!='0'){
                        if(x>=79){
                                cout<<"overflow"<<endl;
                                continue;
                        }
                        cout<<c[0];
                }else{
                        if(x>=80){
                        cout<<"overflow"<<endl;
                        continue;}
                }
                for (int j = 1; j <= x; j++) {
                        cout<<c[j];
                }
                cout<<endl;
        }

}

C++: #include <bits/stdc++.h>
using namespace std;

int main(void){
	string s[55][2];
	int ans[100],k,i,p,q;
	bool flag;
	cin >> q;
	for(p=0; p<q; p++){
		cin >> s[p][0];
		cin >> s[p][1];
		fill(ans,ans+100,0);
		if( s[p][0].length()>80 || s[p][1].length()>80 ){
			cout << "overflow" << endl;
			continue;
		}
		for(k=0; k<2; k++){
			reverse(s[p][k].begin(),s[p][k].end());
			for(i=(s[p][k].length()-1); i>=0; i--){
				ans[i] += (s[p][k][i] - '0');
			}
		}
		for(i=0; i<80; i++){
			ans[i+1] += (ans[i]/10);
			ans[i] %= 10;
		}
		flag = true;
		for(i=99; i>79; i--){
			if(ans[i] != 0){
				cout << "overflow" << endl;
				flag = false;
				break;
			}
		}
		if(!flag){
			continue;
		}
		flag = false;
		for(i=79; i>=0; i--){
			if(flag){
				cout << ans[i];
			}else if(ans[i]!=0){
				cout << ans[i];
				flag = true;
			}
		}
		if(!flag){
			cout << "0";
		}
		cout << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
using namespace std;

int main() {
	int n;
	cin >> n;
	for(int k = 0; k < n; k++) {
		string str1, str2;
		cin >> str1 >> str2;
		int a = str1.size(), b = str2.size();
		if(a > 80 || b > 80) {
			cout << "overflow" <<endl;
		} else if(a >= b) {
			for(int i = 0; i < b; i++) {
				str1[a - b + i] += str2[i] - '0';
				for(int i = a - 1; i >= 0; i--) {
					if(str1[i] > '9') {                 //?????????//
						if(i != 0) {
							str1[i] = str1[i] - ':' + '0';
							str1[i - 1] = str1[i - 1] + 1;
						}
					}
				}
			}
			if(a == 80 && str1[0] > '9') {
				cout << "overflow" <<endl;
			} else {
				for (int j = 0; j < a; j++) {
					if(str1[j] > '9') {
						printf("%d",str1[j] - '0');
					} else cout<< str1[j];
				}
			}
		} else if(b > a) {
			for(int i = 0; i < a; i++) {
				str2[b - a + i] += str1[i] - '0';
				for(int i = b - 1; i >= 0; i--) {
					if(str2[i] > '9') {                    //?????????//
						if(i != 0) {
							str2[i] = str2[i] - ':' + '0';
							str2[i - 1] = str2[i - 1] + 1;
						}
					}
				}
			}
			if(b == 80 && str2[0] > '9') {
					cout << "overflow" <<endl;
			} else {
				for (int j = 0; j < b; j++) { 
					if(str2[j] > '9') {
						printf("%d",str2[j] - '0');
					} else cout << str2[j];
				}
			}
		}
		cout <<endl;
	}
	return 0;
}

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

int n;
char a[1000];
int temp[1000], temp2[1000], temp3[1000];

int main()
{
        std::cin >> n;
	
	while( n-- ){
		memset( temp, -1, sizeof( temp ) );
		memset( temp2, -1, sizeof( temp2 ) );
		memset( temp3, 0, sizeof( temp3 ) );
		
		std::cin >> a;
		
		for( int i = 0; i < strlen( a ); i++ ){
			temp[strlen( a ) - i - 1] = a[i] - '0';
		}
		
		std::cin >> a;
		
		for( int i = 0; i < strlen( a ); i++ ){
			temp2[strlen( a ) - i - 1] = a[i] - '0';
		}
		
		int p = 0, f = 0;
		while( 1 ){
		 	if( temp[p] != -1 && temp2[p] != -1 ){
			 	temp3[p] = ( temp[p] + temp2[p] + f ) % 10;
				f = ( temp[p] + temp2[p] + f ) / 10;
			}
			else if( temp[p] != -1 ){
				temp3[p] = ( temp[p] + f ) % 10;
				f = ( temp[p] + f ) / 10;
			}
			else if( temp2[p] != -1 ){
				temp3[p] = ( temp2[p] + f ) % 10;
				f = ( temp2[p] + f ) / 10;
			}
			else break;
			
			p++;
		}
		
		if( p + f > 80 ){
			std::cout << "overflow" << std::endl;
			continue;
		}
		
		if( f )std::cout << -temp[p];
		
		for( int i = p - 1; i >= 0; i-- ){
		 	std::cout << temp3[i];
		}
		std::cout << std::endl;
	}

 	return 0;
}

C++: #include <stdio.h>
#define MAX 80

int scanLI(int *n);
int addLI(int *a, int *b);
void printLI(int *n);

int main(void){
    int a[MAX],b[MAX];
    char buf[128];
    int n;
    bool of;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        for (int j=0; j<MAX; j++){
            a[j] = b[j] = 0;
        }
        of = false;
        if (scanLI(a) == -1) of = true;
        if (scanLI(b) == -1) of = true;
        if (addLI(a, b) == -1) of = true;
        if (!of){
            printLI(a);
            printf("\n");
        } else {
            printf("overflow\n");
        }
    }
    
    return 0;
}

int scanLI(int *n){
    char buf[128];
    int len;
    
    scanf("%s", buf);
    for (len=0; buf[len]!='\0'; len++);
    if (len>MAX){
        return -1;
    }
    for (int i=0; i<len; i++){
        n[i] = buf[len-i-1]-'0';
    }
    return 0;
}

int addLI(int *a, int *b){
    int c=0;
    
    for (int i=0; i<MAX; i++){
        a[i] += b[i]+c;
        c = a[i]/10;
        a[i] %= 10;
    }
    return c ? -1 : 0;
}

void printLI(int *n){
    bool zero=true;
    
    for (int i=MAX-1; i>=0; i--){
        if (n[i]==0){
            if (!zero) printf("0");
        } else{
            zero = false;
            printf("%d", n[i]);
        }
    }
}