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<algorithm>
#include<cstring>
#include<string>
#include<cstdio>
#define MOJI 48
using namespace std;
int multiple(string a,string b);
char c[111111];
int main(){
  int n;
  string a,b;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a;
    cin >> b;
    int k = multiple( a , b );
    if(k>=80){
      cout << "overflow" << endl;
    }else {
      for(int i=k-1;i>=0;i--){
	printf("%d",c[i]);
      }
      cout << endl;
    }
  }
}
int multiple(string a,string b){
  int a_size,b_size,w=0;
  char k = 0; // 桁上げ
  a_size = a.size();
  b_size = b.size();
  while(a_size>0 || b_size>0 || k == 1){
    if(a_size>0 && b_size>0){
      c[w] = (a[a_size-1] - MOJI + b[b_size-1] - MOJI + k) % 10;
      k = (k + (a[a_size-1]-MOJI) + (b[b_size-1]-MOJI)) / 10;
    }
    else if(a_size>0 && b_size<=0){
      c[w] = ((a[a_size-1]-MOJI) + k) % 10;
      k = (a[a_size-1]-MOJI + k) / 10;
    }
    else if(a_size<=0 && b_size>0){
      c[w] = (b[b_size-1] - MOJI + k) % 10;
      k = (k + b[b_size-1] - MOJI) / 10;
    }else {
      c[w] = k;
      k = 0;
    }
    a_size--;
    b_size--;
    w++;
  }
  return w;
}

C++: #include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;

int main()
{
	
	
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		string a;
		string b;

		cin >> a;
		cin >> b;	
		string res;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		int carry = 0;
		int idx;
		for(int j=0;j<min(a.size(),b.size());j++){
			int lhs = a[j] - '0';
			int rhs = b[j] - '0';
			res.push_back((carry + lhs + rhs) % 10 + '0');
			carry = (carry + lhs + rhs) / 10 ? 1 : 0;
			idx =j;
		}

		for(int j=idx+1;j<max(a.size(),b.size());j++){
			if(a.size() > b.size()){
				int lhs = a[j] - '0';
				res.push_back((carry + lhs) % 10 + '0');
				carry = (carry + lhs) / 10 ? 1 : 0;
			}
			else{
				int rhs = b[j] - '0';
				res.push_back((carry + rhs) % 10 + '0');
				carry = (carry + rhs) / 10 ? 1 : 0;
			}
		}
		if(carry) res.push_back(carry+'0');
		reverse(res.begin(),res.end());
		res = (res.size() > 80) ? "overflow" : res;
		cout << res << endl;
	}	
}

C++: #include<stdio.h>

int main(void)
{
	int x,y,n,m,sum;
	scanf("%d",&n);

	for(int t=0;t<n;t++)
	{
		scanf("%d",&x);
		scanf("%d",&y);

		sum=x+y;
		int keta;
		keta=sum/10;
		for(m=1;m<80;m++)
		{
			keta=keta/10;
		}

		if(keta>=0)
		{
			printf("overflow\n");
		}
		else
		{
			printf("%d",sum);
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stack>
using namespace std;

int main() {
	int k,a,b,c,d,i,j,s;
	stack<int> st[3];
	char n[2][1000];
	cin >> d;
	for (d;d>0;d--) {
    n[0][81]='*' ; n[1][81]='*';
	cin >> n[0] >> n[1];
	if (n[0][81]!='*' || n[1][81]!='*') { cout << "overflow" << endl; continue;}
	for (i=0;i<2;i++) for (j=0;n[i][j]!='\0';j++) st[i].push(n[i][j]-'0');
	k=0; c=0;
	while(!st[0].empty() || !st[1].empty()) {
		if (!st[0].empty()) {a=st[0].top(); st[0].pop();} else a=0;
		if (!st[1].empty()) {b=st[1].top(); st[1].pop();} else b=0;
		s=a+b+c; k++;
		if (s>9) { c=1; s-=10; } else c=0;
		st[2].push(s);
	}
	if ((c==1 && k==80) || k>80) { 
		cout << "overflow" << endl;
		while(!st[2].empty()) st[2].pop();
	}
	else {
		if (c==1) cout << 1;
		while(!st[2].empty()) { 
			cout << st[2].top();
			st[2].pop();
		}
		cout << endl;
	}
}
		return 0;
}

C++: #include<cstdio>

int main(){
	int a[82] = {};
	int b[82] = {};
	int c[82] = {};
	int n;
	int k,l,m,f;
	char t;
	int of;

	scanf("%d", &n);

	for(int i = 0; i < n; i++){
		of = k = l = 0;
		scanf("%c", &t);
		while(t - 10){
			k++;
			a[k] = t - '0';
			scanf("%c", &t);
			if(k == 80){
				of = 1;
				while(t - 10){
					scanf("%c", &t);
				}
			}
		}
		scanf("%c", &t); 

		while(t - 10){
			l++;
			b[l] = t - '0';
			scanf("%c", &t);
			if(l == 80){
				of = 1;
				while(t - 10){
					scanf("%c", &t);
				}
			}

		}

		m = 0;
		f = 0;

		while(k - m){
			c[m] = a[k - m];
			m++;
		}
		m = 0;
		while(l - m){
			c[m] += b[l - m ] + f;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		while(f){
			c[m] += 1;
			f = 0;
			if(c[m] > 9){
				c[m] -= 10;
				f = 1;
			}
			m++;
		}

		if(k > m){
			m = k;
		}

		for(int i = 0; i < m; i++){
			if(m == 81 || of){
				printf("overflow");
				f = 1;
				i = m;
			}else{
				if((c[m - i -1]) || f){
					printf("%d", c[m - i - 1]);
					f = 1;
				}
			}
		}
		if(f - 1){
			printf("0");
		}
		printf("\n");
	}
	return 0;
}