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 <iostream>
#include <string>

using namespace std;

int main() {

	string a;
	string b;
	int kari;

	cin >> kari;

	for (int o = 0; o < kari; o++) {
		int c[80] = {0};
		int d[80] = {0};
		int e[81] = {0};
		int counter = 0;

		cin >> a;
		cin >> b;
	
		if (a.size() > 80 || b.size() > 80) {
			cout << "overflow" << endl;
			continue;
		} else {
			for (int i = a.size() - 1; i >= 0; i--) {
				c[a.size() - 1 - i] = a[i] - '0';
			}

			for (int i = b.size() - 1; i >= 0; i--) {
				d[b.size() - 1 - i] = b[i] - '0';
			}

			for (int j = 0; j < 80; j++) {
				e[j] += c[j] + d[j];
				if (e[j] >= 10) {
					e[j+1] = e[j] / 10;
					e[j] = e[j] % 10;
				} 
			}
		}

		if (e[80] > 0) {
			cout << "overflow" << endl;
		} else {
			for (int k = 79; k >= 0; k--) {
				if (e[k] != 0) {
					counter = k;
					break;
				}
			}
			for (int k = counter; k >= 0; k--) {
				cout << e[k];
			}
			cout << endl;
		}
	}
	return 0;
}

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

int main(){
	int N;
	cin >> N;
	while(N--){
		string a,b;
		cin >> a >> b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		while(a.size()>b.size())b += '0';
		while(a.size()<b.size())a += '0';
		string r;
		int c = 0; 
			for(int i = 0 ; i < a.size() ; i++){
			int d = a[i] + b[i] + c - 2 * '0';
			if( d >= 10 ) c = 1;
			else c = 0;
			r += d%10 + '0';
		}
		if(c)r += '0' + c;
		reverse(r.begin(),r.end());
		if( r.size() > 80 ) cout << "overflow" << endl;
		else cout << r << endl;
	}
}

C++: #include<iostream>
#include<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]]-'0';
				if(in[NMin][ien[NMin]+1]>9+'0'){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			max10=0;
			
			for(;ien[NMin]>-1;ien[NMin]--){
				in[NMin][ien[NMin]]=in[NMin][ien[NMin]]-'0';
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			
			
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

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

using namespace std;

string reverse(const string& str){
  string ret;
  string::const_reverse_iterator it = str.rbegin();
  for(; it != str.rend(); it++) {
    ret.push_back(*it);
  }
  return ret;
}

void cut0(string& str){
  while(str[str.size() - 1] == '0' && str.size() > 1){
    str.erase(str.size() - 1);
  }
}

int main () {
  int n;
  string a, b, sum;
  
  cin >> n;
  while(n--) {
    bool overflow = false;

    cin >> a >> b;
    a = reverse(a);
    b = reverse(b);
    a.resize(80, '0');
    b.resize(80, '0');
    sum.clear();
    sum.resize(80, '0');
    
    for(size_t i = 0; i < 80; i++) {
      sum[i] += a[i] - '0' + b[i] - '0';
      if(sum[i] > '9'){
        sum[i] -= 10;
        if(i < 79) {
          sum[i+1] = '1';
        }
        else {
          overflow = true;
          break;
        }
      }
    }
    if(overflow){
      cout << "overflow" << endl;
    }
    else {
      cut0(sum);
      cout << reverse(sum) << endl;
    }
  }
}

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

int main(){
	string s1, s2;
	int n, n1[100], n2[100];cin >> n;
	for(int g = 0;g < n;g++){
		int f = 0;
		cin >> s1 >> s2;
		for(int i = 0;i < 100;i++)n1[i] = n2[i] = 0;
		if(s1.size()>80 || s2.size()>80)f = 1;
		if(!f){
		for(int i = 0;i < s1.size();i++)n1[i] = s1[s1.size()-i-1] - '0';
		for(int i = 0;i < s2.size();i++)n2[i] = s2[s2.size()-i-1] - '0';
		
		
		for(int i = 0;i < 90;i++){
			n1[i] += n2[i];
			if(n1[i] > 9){n1[i] = n1[i]%10;n1[i+1]++;}
		}
		int flag = 0;
		for(int i = 90;i >= 0;i--){
			if(!flag && i == 0)cout << 0;
			if(flag && i >= 80)break;
			if(flag)cout << n1[i];
			if(!flag && i > 0 && n1[i-1] != 0)flag = 1;
		}
		if(!f)cout << endl;
		}
		if(f)cout << "overflow" << endl;
	}
	return 0; 
}