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<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
for(int b=0;b<a;b++){
    int goukei[81]{};
    char c[110]{},d[110]{};
    scanf("%s%s",c,d);
    int e,f;
    e=strlen(c);f=strlen(d);
    if(e>80||f>80)puts("overflow");
    e--;f--;
    for(int g=80;g!=0;g--,e--,f--){
	int s=goukei[g];
	if(e>-1)s+=c[e]-48;
	if(f>-1)s+=d[f]-48;
	goukei[g-1]=s/10;
	goukei[g]=s%10;
	}
	if(goukei[0])puts("overflow");
	else{
	    bool ss=false;
	    for(int m:goukei){
		if(m)ss=true;
		if(ss)printf("%d",m);
		}
		puts("");
	    }
    }
}

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

using std::cin;
using std::cout;
using std::endl;
using std::vector;

constexpr int MAX_DIGIT = 80;

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

    while (data_num--) {
        std::string in01_str, in02_str;
        cin >> in01_str >> in02_str;

        vector<char> in01_ch(in01_str.rbegin(), in01_str.rend());
        vector<char> in02_ch(in02_str.rbegin(), in02_str.rend());

        std::size_t size;
        if (in01_ch.size() < in02_ch.size()) {
            size = in02_ch.size();
            in01_ch.resize(size, '0');
        } else {
            size = in01_ch.size();
            in02_ch.resize(size, '0');
        }

        vector<int> in01(size), in02(size);
        for (unsigned i = 0; i < size; i++) {
            in01.at(i) = in01_ch.at(i) - '0';
            in02.at(i) = in02_ch.at(i) - '0';
        }

        vector<int> out;
        bool is_over = false;
        for (unsigned i = 0; i < size; i++) {
            int num = in01.at(i) + in02.at(i) + (is_over? 1: 0);
            is_over = (num > 9)? true: false;

            out.push_back(num % 10);
        }
        if (is_over) {
            out.push_back(1);
        }

        if (out.size() > MAX_DIGIT) {
            cout << "overflow" << endl;
            continue;
        }

        for (unsigned i = 0; i < out.size(); i++) {
            cout << out.at(out.size() - 1 - i);
        }
        cout << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main(){
long n,i,j,k,l,m,u,v,c;
string s,t,w;
char p[81];
cin>>n;
for(k=0;k<n;k++){
cin>>s>>t;
l=s.size();if(l>80){cout<<"overflow"<<endl;continue;}
m=t.size();if(m>80){cout<<"overflow"<<endl;continue;}
if(l<m){w=s;s=t;t=w;}
for(c=0,i=l-1,j=m-1;j>=0;i--,j--){
u=s[i]-48;v=t[j]-48;
u+=v+c;
c=0;
if(u>9){c=1;u-=10;}
s[i]=u+48;
}
for(;i>=0;i--){
u=s[i]-48;
u+=c;
c=0;
if(u>9){c=1;u-=10;}
s[i]=u+48;
}
if(l==80&&c==1){cout<<"overflow"<<endl;continue;}
if(c==1)cout<<"1";cout<<s<<endl;
}
return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#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}, z[81]={0};

		cin >> a;
		cin >> b;
		if(a.size()>80 || b.size()>80){
		cout << "overflow" <<endl;
		continue;
		}
		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++){
			z[j]+=x[j]+y[j];
			if(z[j]>=10){
				z[j+1]++;
				z[j]-=10;
			}
		}
		
		if(z[80]>0){
			cout << "overflow" <<endl;
		}else{
			bool flag = 0;
			for(int j=79;j>=0;j--){
				if(z[j]==0&& flag==0){
					continue;
				}else{
					flag=1;
				}
				cout<<z[j];
			}
			if(flag==0){
				cout<<0;
			}
			cout<<endl;
			
		}
		
	}
	
	return 0;
}

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

using namespace std;

void tasu(string s1, string s2){
        int num[2][max(s1.length(), s2.length())+1];
        for(int i = 0; i < sizeof(num[0])/sizeof(int); i++){
                if(s1.length() > i){ 
                        num[0][i] = (int)s1.at(s1.length()-1-i) - (int)'0';
                }else{
                        num[0][i] = 0;
                }   
                if(s2.length() > i){ 
                        num[1][i] = (int)s2.at(s2.length()-1-i) - (int)'0';
                }else{
                        num[1][i] = 0;
                }   
        }   
        for(int i = 0; i < sizeof(num[0])/sizeof(int)-1; i++){
                num[1][i] += num[0][i];
                if(num[1][i] > 9){ 
                        num[1][i+1] += (int)(num[1][i]/10);
                        num[1][i] %= 10; 
                }   
        }   
        int keta = sizeof(num[0])/sizeof(int);
        while(keta && !num[1][keta-1]){
                keta--;
        }   
        if(keta => 80){
                cout << "overflow" << endl;
        }else{
                while(keta--){
                        cout << num[1][keta];
                }   
                cout << endl;
        }   
}
int main(){
        int n;
        cin >> n;
        while(n--){
                string s1, s2; 
                cin >> s1 >> s2; 
                tasu(s1, s2);
        }   
}