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<cctype>
#include<cstring>
using namespace std;
int main(){
  int o,a,sl,ss,ansl[82],anss[82];
  cin >> o;
  char n[81],n2[81],nl[82],ns[82],c[80];
  cin.getline(c,80); 
  for(int i=0;i<o;i++){
    cin.getline(n,81);
    cin.getline(n2,81);
    a = 0;
    if( strlen(n)>strlen(n2) ){
      sl = strlen(n);     
      ss = strlen(n2);
      for(int i=sl-1;i>=0;i--){
	nl[a] = n[i];
	a++;
      }
      a = 0;
      for(int i=ss-1;i>=0;i--){
	ns[a] = n2[i];
	a++;
      }
    }
    else{
      sl = strlen(n2);
      ss = strlen(n);
      for(int i=sl-1;i>=0;i--){
	nl[a] = n2[i];
	a++;
      }
      a = 0;
      for(int i=ss-1;i>=0;i--){
	ns[a] = n[i];
	a++;
      }
    }
    for(int i=0;i<sl;i++) ansl[i] = nl[i]-'0';
    for(int i=0;i<ss;i++) anss[i] = ns[i]-'0';
    for(int i=0;i<ss;i++) ansl[i] += anss[i];
    for(int i=0;i<sl;i++){
      if(ansl[i]>=10){
	ansl[i] -= 10;
	if(i+1<sl) ansl[i+1] += 1;
	else{
	  ansl[i+1] = 1;
	  sl += 1;
	}
      }
    }
    if(sl>80) cout << "overflow";
    else  for(int i=sl-1;i>=0;i--) cout << ansl[i];
    cout << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
#include <list>
using namespace std;
 
int main()
{
    int n;
    cin>> n;
    string str1,str2;
    vector<string>s1;
    vector<string>s2;
    for(int i=0;i<n;i++){
       cin>>str1;
       s1.push_back(str1);  
       cin>>str2;    
       s2.push_back(str2);       
    }
    for(int i=0;i<n;i++){
           string str3=s1[i];
           string str4=s2[i];
           int k=str3.size();
           int l=str4.size();           
           int max=k>l?k:l;
           if(max>80) cout<<"overflow"<<endl;
           else{
           int a[80]={0};
           int b[80]={0};
           for(int j=0;j<k;j++){
                a[j]=str3[j]-'0'; } 
           for(int j=0;j<l;j++){
                b[j]=str4[j]-'0'; }
           int temp=0;
           char s[80];
           for(int i=0;i<max;i++){
               int d;
               if(l>i&&k>i) d=a[k-1-i]+ b[l-1-i]+temp;
               if(l<=i&&k>i) d=a[k-1-i]+temp;
               if(l>i&&k<=i) d=b[l-1-i]+temp;
               s[max-1-i]=(d%10)+'0';
               if(d>=10) temp=1;
               else temp=0;
           }
           if(strlen(s)+temp>80) cout<<"overflow"<<endl;
           else{ 
                 if(temp==1) cout<<"1";
                 for(int i=0;i<max;i++){
                    cout<<s[i];}
                }
          cout<<endl;
        }
    }   
    return 0; 
}

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

using namespace std;
void add(string &,string &,string &);
int main() {
	string a,b;
	int al,bl;
	int n;
	cin>>n;
	while(n--){
	        string ans="";
		cin>>a>>b;
		reverse(a.begin(),a.end());
		reverse(b.begin(),b.end());
		al=a.size();
		bl=b.size();
		if(bl>al){
			swap(a,b);
			swap(al,bl);
		}
		for(int i=bl;i<al;i++){
			b+='0';
		}
		add(ans,a,b);
		if(ans.size()>80){
		  printf("overflow\n");
		}else{
		  reverse(ans.begin(),ans.end());
		  cout<<ans<<endl;
		}
	  	
	}
	return 0;
}
void add(string &ans,string &a,string &b){
	int x,y=0;
	int i;
	int al=a.size();
	for(i=0;i<al;i++){
		x=a[i]-'0'+b[i]-'0';
		if((x+y)>=10){
		        ans+= ((x+y)%10)+'0';
			y=1;
		}else{
		        ans+= (x+y)+'0';
			y=0;
		}
	}
	if(y==1)ans+='1';
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


int main(){
	
	int n;
	cin>>n;
	
	rep(loop,n){
		vector<int> ans;
		vector<int> a;
		vector<int> b;
		
		string c,d;
		cin>>c>>d;
		
		rep(i,c.size()){
			a.push_back(c[c.size()-1-i]-'0');
		}
		rep(i,d.size()){
			b.push_back(d[d.size()-1-i]-'0');
		}
		
		
		int kuri = 0;
		while(!a.empty() || !b.empty() || kuri!=0){
			int sum = kuri;
			kuri = 0;
			
			if(!a.empty()){
				sum += a[0];
				a.erase(a.begin());
			}
			
			if(!b.empty()){
				sum += b[0];
				b.erase(b.begin());
			}
			
			ans.push_back(sum%10);
			kuri += sum/10;
		}
		
		if(ans.size()>80)puts("overflow");
		else{
			rep(i,ans.size()){
				printf("%d",ans[ans.size()-1-i]);
			}puts("");
		}
	}
	
}