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 <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {

  int n;

  char buf[100];
  char outbuf[100];

  char c;

  int a[100],b[100];
  int result[100];
  
  int sum,carry;
  int idx1,idx2;
  int maxlen;

  int i,j;

  scanf("%d",&n);

  c=getchar();

  for(i=0;i<n;i++) {

    fgets(buf,sizeof(buf),stdin);

    idx1=0;

    while(buf[idx1]!='\n') {

      a[idx1]=buf[idx1]-48;

      idx1++;

    }

    //for(j=0;j<idx1;j++) printf("%d",a[j]);

    fgets(buf,sizeof(buf),stdin);

    idx2=0;

    while(buf[idx2]!='\n') {

      b[idx2]=buf[idx2]-48;

      idx2++;

    }

    if(idx1>idx2) maxlen=idx1;
    
    else maxlen=idx2;

    carry=0;

    for(j=0;j<maxlen;j++) {

      if(j<idx1 && j<idx2) sum=a[idx1-j-1]+b[idx2-j-1]+carry;

      else if(j>=idx1) sum=b[idx2-j-1]+carry;

      else sum=a[idx1-j-1]+carry;


      if(sum>=10) carry=1;

      else carry=0;

      result[j]=sum%10;

    }
    //printf("%d\n",carry);
    if(carry==1) {

      if(maxlen>=80) printf("overflow\n");

      else {

	outbuf[0]='1';

	for(j=0;j<maxlen;j++) {

	  outbuf[j+1]=result[j]+48;

	}

	outbuf[maxlen+1]='\0';

	printf("%s",outbuf);

	puts("");

      }

    }

    else {

      for(j=0;j<maxlen;j++) {

	outbuf[j]=result[j]+48;

      }

      outbuf[maxlen]='\0';

      printf("%s",outbuf);

      puts("");

    }

  }

  return 0;

}

C++: #include <iostream>
#include <string>
#include <stack>
#include <cstdlib>

using namespace std;

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

  for (int N_i = 0; N_i < N; N_i++) {
    bool overflow = false;
    string str_data1, str_data2;
    cin >> str_data1;
    cin >> str_data2;

    stack<int> data1, data2; 
    for (int data1_i = 0; data1_i < str_data1.size(); data1_i++) {
      char buff[2];
      buff[0] = str_data1[data1_i];
      buff[1] = '\0';
      data1.push(atoi(buff));
    }
    if (data1.size() >= 80) {
      cout << "overflow" << endl;
      continue;
    }
    for (int data2_i = 0; data2_i < str_data2.size(); data2_i++) {
      char buff[2];
      buff[0] = str_data2[data2_i];
      buff[1] = '\0';
      data2.push(atoi(buff));
    }
    if (data2.size() >= 80) {
      cout << "overflow" << endl;
      continue;
    }

    stack<int> sum;
    int carry = 0;
    int flag = data1.size() < data2.size() ? 0 : 1;
    while(flag == 0 ? !data1.empty() : !data2.empty()) {
      int presum = data1.top() + data2.top() + carry;
      carry = presum / 10;
      sum.push(presum % 10);
      data1.pop();
      data2.pop();
    }
    stack<int> *data;
    data = data1.size() > data2.size() ? &data1: &data2;
    while(!data->empty()) {
      int presum = data->top() + carry;
      carry = presum / 10;
      sum.push(presum % 10);
      data->pop();
    }

    if (carry != 0)
      sum.push(carry);

    if (sum.size() >= 80) {
      cout << "overflow" << endl;
      continue;
    }

    if (overflow) {
      cout << overflow << endl;
    } else {
      for (int sum_i = 0; !sum.empty(); sum_i++) {
        cout << sum.top();
        sum.pop();
      }
      cout << endl;
    }
  }

  return 0;
}

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

using namespace std;

int main(){
	int N; cin >> N;
	for(int i = 0; i < N; i++){
		long double a, b;
		cin >> a >> b;
		if(log10(a + b) > 79){
			cout << "overflow" << endl; 
			return 0;
		}
		cout << a + b << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

const int N_MAX = 101;
int d1[N_MAX], d2[N_MAX], cr[N_MAX];
int N;
string s1, s2;

int main() {
    cin >> N;

    while (N--) {
        cin >> s1;
        cin >> s2;

        reverse(s1.begin(), s1.end());
        reverse(s2.begin(), s2.end());

        fill(d1, d1 + N_MAX, 0);
        fill(d2, d2 + N_MAX, 0);
        fill(cr, cr + N_MAX, 0);

        for (int i = 0; i < s1.length(); i++) { d1[i] = s1[i] - '0'; }
        for (int i = 0; i < s2.length(); i++) { d2[i] = s2[i] - '0'; }

        string ans;
        int d;

        for (int i = 0; i <= max(s1.length(), s2.length()); i++) {
            d = d1[i] + d2[i] + cr[i];
            ans += to_string(d % 10);
            if (d >= 10) cr[i + 1] = 1;
        }

        if (ans.back() == '0') {
            ans.erase(ans.length() - 1, 1);
        }

        reverse(ans.begin(), ans.end());

        if (ans.length() > 80) {
            ans = "overflow";
        }

        cout << ans << endl;
    }
}