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

int main(){
  std::string str1,str2,sumstr;
  int n;
  std::cin>>n;
  std::vector<std::string> ans;
  while((ans.size()<n)&&std::cin>>str1>>str2){
    sumstr.clear();
    std::reverse(str1.begin(),str1.end());
    std::reverse(str2.begin(),str2.end());
    unsigned size=std::min(str1.size(),str2.size());
    unsigned i;
    unsigned carry=0;
    for(i=0;i<size;++i){
      unsigned sum=str1[i]+str2[i]+carry-'0'*2;
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    std::string large=(str1.size()>str2.size())?str1:str2;
    for(;i<large.size();++i){
      unsigned sum=large[i]+carry-'0';
      sumstr.push_back(sum%10+'0');
      carry=sum/10;
    }
    if(carry)sumstr.push_back(carry+'0');
    std::reverse(sumstr.begin(),sumstr.end());
    sumstr.push_back('\0');
    ans.push_back(sumstr);
  }
  for(auto s:ans){
    if(s.size()<=81)
      std::cout<<s<<std::endl;
    else
      std::cout<<"overflow"<<std::endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <stack>

using namespace std;

int main (int argc, char * const argv[]) {
    // insert code here...
	int n;
    string a, b;
		
	cin>> n;	
	for(int i=0;i<n;i++){
		int x[81]={0}, y[81]={0};

		cin >> a;
		cin >> b;
		
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		
		for(int j=0;j<a.size();j++){
			x[j]=a[j]-'0';
		}
		for(int j=0;j<b.size();j++){
			y[j]=b[j]-'0';
		}
		
		for(int j=0;j<80;j++){
			x[j]=x[j]+y[j];
			if(x[j]>=10){
				x[j+1]++;
				x[j]-=10;
			}
		}
		cout << 0 << endl;
		/*
		if(x[80]>0){
			cout << "overflow" <<endl;
		}else{
			bool flag = 0;
			for(int j=79;j>=0;j--){
				if(x[j]!=0){
					cout<<x[j];
					flag=1;
				}else if(flag){
					cout<<x[j];
				}
			}
			cout<<endl;
		}
		*/
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
int main(void){
    int ap,bp,cp,t;
    char a[999],b[999],c[82];
    scanf("%d",&t);
    while(~scanf("%s%s",&a,&b)){
        ap=strlen(a);
        bp=strlen(b);
        c[cp=(ap>80||bp>80)?0:81]='\0';
        t=0;
        while((t||ap||bp)&&cp>0){
            t+=(ap?a[--ap]-'0':0)+(bp?b[--bp]-'0':0);
            c[--cp]='0'+t%10;
            t/=10;
        }
        if(cp>0)puts(&c[cp]);
        else puts("overflow");
    }
    return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>
#include <stack>

using namespace std;

int main(){
    
    string d;
    string e;
    
    stack<char> st1;
    stack<char> st2;
    stack<int> st3;
    int n=0;
    scanf("%d",&n);
    
    for(int i=0; i<n; i++){
        cin>>d;
        cin>>e;
        
    }
    
    for(int j=0; j<(int)(d.size()); j++){
        st1.push(d[j]);
    }
    for(int j=0; j<(int)(e.size()); j++){
        st2.push(e[j]);
    }
    int temp=0;
    char temp_char;
    while(st1.empty()==false||st2.empty()==false){
        if(st1.empty()==false&&st2.empty()==false){
            temp_char=st1.top();
            temp+=atoi(&temp_char);
            temp_char=st2.top();
            temp+=atoi(&temp_char);
            st1.pop();
            st2.pop();
        }else if(st1.empty()==false&&st2.empty()==true){
            temp_char=st1.top();
            temp+=atoi(&temp_char);
            st1.pop();
        }else if(st1.empty()==true&&st2.empty()==false){
            temp_char=st2.top();
            temp+=atoi(&temp_char);
            st2.pop();
        }
        st3.push(temp%10);
        temp=temp/10;
    }
    
    if(temp!=0){
        st3.push(temp);
    }
    
    if(st3.size()>80){
        printf("overflow");
    }else{
        while(st3.empty()==false){
            printf("%d",st3.top());
            st3.pop();
        }
    }
    
    
    printf("\n");
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>
#include <cstdlib>
#include <typeinfo>
using namespace std;



int main(){
	int n,m;
	string x, y,z;
	double a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x >> y;
		if (x.length() > 80 || y.length() > 80)
		{
			cout << "overflow" << endl;
		}
		else
		{
			a = stod(x);
			b = stod(y);
			if (to_string(a + b).length() > 80)
			{
				cout << "overflow" << endl;
			}
			else
			{
				z = to_string(a + b);
				z.erase(z.begin() + z.length() - 7, z.begin() + z.length());

				cout << z << endl;
			}
		}
	}
}