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 <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <algorithm>
#include <set>
#define INF 10000000
using namespace std;
typedef pair<int,int> P;

int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    string str1,str2;
    cin >> str1 >> str2;
    if(str1.size()>str2.size()){
      string temp = str1;
      str1 = str2;
      str2 = temp;
    }

    int len1 = str1.size(),len2 = str2.size();
    int kuriagari = 0;
    for(int j=1;len2-j>=0;j++){
      if(len1-j>=0){
        int sum = (str2[len2-j]-'0') + (str1[len1-j]-'0') + kuriagari;
        if(sum>=10){
          sum -=10;
          kuriagari = 1;
        }else{
          kuriagari = 0;
        }
        str2[len2-j] = sum+'0';
      }else{
        if(kuriagari){
          int sum = (str2[len2-j]-'0') + kuriagari;
          if(sum>=10){
            sum -=10;
            kuriagari = 1;
          }else{
            break;
          }
          str2[len2-j] = sum+'0';
        }else{
          break;
        }
      }
    }
    if(kuriagari){
      str2 = "1" + str2;
    }
    cout << str2 << endl;
  }
}

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

#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;

#define CINT cpp_int 

int main() {
	int n; cin >> n; CINT a, b; 
	CINT REF = pow(CINT(10), 80);
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		if (a + b >= REF) cout << "overflow" << endl;
		else cout << a + b << endl;
	}
	return 0;
}

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

void str_plus(string &str, int d, int i){
  int keta = str.size()-i-1;//?????¨?¶??????????????????±???
  if(keta < 0){
    str.insert(0, "0");
    keta++;
  }
  int r = str[keta] - '0' + d;
  str[keta] = '0' + r % 10;
  if(r/10)
    str_plus(str, r/10, i+1);
}
int main(){
  int n;
  string str1, str2;
  cin >> n;
  for(int i = 0;i < n;i++){
    cin >> str1 >> str2;
    for(int i = 0; i < str2.size(); i++)
      str_plus(str1, str2[str2.size()-i-1]-'0', i);

    cout << str1 << endl;
  }
  return 0;
}

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

int main(){
  int j;
  int n;
  char s1[111];
  char tmp[111];
  char s2[111];
  char ans[180];
  int  kuri = 0;
  cin >> n;
  while(n--){
  memset(ans,0,sizeof(ans));
  memset(s1,0,sizeof(s1));
  memset(s2,0,sizeof(s2));
  memset(tmp,0,sizeof(tmp));
  cin >> s1 >> s2;
  if(strlen(s1) < strlen(s2)){
      for(int i=0,j=strlen(s1)-1;i<=j;i++,j--) swap(s1[i],s1[j]);
      for(int i=0,j=strlen(s2)-1;i<=j;i++,j--) swap(s2[i],s2[j]);
      for(int i=0;i<strlen(s2);i++){
	if((s2[i] + (s1[i]%'0') + kuri) > '9'){
	  ans[i] = (s2[i] + (s1[i]%'0') + kuri)-10;
	  kuri = 1;
	}
	else {
	  ans[i] = (s2[i] + (s1[i]%'0') + kuri);
	  kuri = 0;
	}
	if(i == strlen(s2)-1 && kuri == 1) ans[i+1] = '1';
      }
      if(strlen(ans) > 80) cout << "overflow" << endl;
      else{
	for(int i=strlen(ans)-1;i>=0;i--) cout << ans[i];
      }
  }
  else{
    for(int i=0,j=strlen(s1)-1;i<=j;i++,j--) swap(s1[i],s1[j]);
    for(int i=0,j=strlen(s2)-1;i<=j;i++,j--) swap(s2[i],s2[j]);
    for(int i=0;i<strlen(s1);i++){
      if((s1[i] + (s2[i]%'0') + kuri) > '9'){
	ans[i] = (s1[i] + (s2[i]%'0') + kuri)-10;
	kuri = 1;
      }
      else {
	ans[i] = (s1[i] + (s2[i]%'0') + kuri);
	kuri = 0;
      }
      if(i == strlen(s1)-1 && kuri == 1) ans[i+1] = '1';
    }
    if(strlen(ans) > 80) cout << "overflow" << endl;
    else{
      for(int i=strlen(ans)-1;i>=0;i--) cout << ans[i];
    }
  }
  cout << endl;
  }
}

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 > 79 || b > 79) {
			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 == 79 && str1[0] > '9') {
				cout << "overflow" <<endl;
			} else {
				for (int j = 0; j < a; j++) {
					if(str1[j] > '9') {
						printf("1%c",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] - ':';
							str2[i - 1] = str2[i - 1] + 1;
						}
					}
				}
			}
			if(b == 79 && str2[0] > '9') {
					cout << "overflow" <<endl;
			} else {
				for (int j = 0; j < b; j++) { 
					if(str2[j] > '9') {
						printf("1%c",str2[j] - ':' + '0');
					} else cout << str2[j];
				}
			}
		}	
		cout <<endl;
	}
	return 0;
}