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;
char str[102],str1[102],ans[102];
int sam(int ma1,int ma2)
{
    int co,carry=0,a,b;
    for(int i=0;ma1-i>=0||ma2-i>=0||carry==1;i++){
            if(ma1-i>=0&&ma2-i>=0){
                    a=str[ma1-i]-'0';
                    b=str1[ma2-i]-'0';
                    if(a+b+carry>=10){
                        ans[i]=a+b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+b+carry+'0';
                        carry=0;
                    }
            }
            else if(ma1-i>=0){
                    a=str[ma1-i]-'0';
                    if(a+carry>=10){
                        ans[i]=a+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=a+carry+'0';
                        carry=0;
                    }
            }
            else if(ma2-i>=0){
                    b=str1[ma2-i]-'0';
                    if(b+carry>=10){
                        ans[i]=b+carry-10+'0';
                        carry=1;
                    }
                    else {
                        ans[i]=b+carry+'0';
                        carry=0;
                    }
            }
            else {
                ans[i]='0'+1;
                return i;
            }
        co=i;

    }
    return co;

}
int main()
{
    int a,b,n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>str>>str1;
        a=strlen(str);
        b=strlen(str1);
        a=sam(a,b);
        if(a>80)cout<<"overflow\n";
        else for(int j=a;j>0;j--)cout<<ans[j];
        cout<<endl;
    }

}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	int N; cin >> N ;
	for(int i=0;i<N;i++)
	{
		string str,ptr,temp,ans; cin >> str >> ptr ;
		int lens,lenp,len;
		lens=str.size(); lenp=ptr.size();
		bool flag=false; len=max(lens,lenp);
		temp=str; for(int i=0;i<lens;i++) str[i]=temp[lens-i-1];
		temp=ptr; for(int i=0;i<lenp;i++) ptr[i]=temp[lenp-i-1];
		for(int i=0;i<len;i++)
		{
			int temp;
			if(i>=lens && i<lenp) temp=ptr[i]-'0';
			else if(i<lens && i>=lenp) temp=str[i]-'0';
			else temp=(str[i]-'0')+(ptr[i]-'0'); 
			if(flag==true) temp++,flag=false;
			if(temp>=10) flag=true,temp%=10;
			char ch='0'+temp;
			if(!i) ans=ch;
			else ans+=ch;
		}
		if(flag==true) ans+='1';
		temp=ans; int LEN=ans.size();
		for(int i=0;i<LEN;i++) ans[i]=temp[LEN-i-1];
		if(LEN>80) ans="overflow";
		cout << ans << '\n' ;
	}
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	int n;
	cin >> n;
	while(n--){
		string a, b;
		bool cu = false;
		cin >> a >> b;
		int al = a.length(), bl = b.length(), ans[101] = {0};
		for(int i = 0; i < min(al, bl); i++){
			ans[i] = a[al-i-1] + b[bl-i-1] - 48 * 2;
			if(cu) ans[i]++;
			if(ans[i] >= 10){
				ans[i] %= 10;
				cu = true;
			}else cu = false;
		}
		for(int i = min(al, bl); i < max(al, bl); i++){
			if(al > bl) ans[i] = a[al-i-1] - 48 + cu;
			else ans[i] = b[bl-i-1] - 48 + cu;
			if(ans[i] >= 10){
				ans[i] %= 10;
				cu = true;
			}else cu = false;
		}
		if(cu) ans[max(al, bl)] = 1;
		if(max(al, bl)+cu > 80) cout << "overflow" << endl;
		else for(int i = (cu? max(al, bl):max(al, bl)-1); i >= 0; i--) cout << ans[i];
		cout << endl;
	}
	return 0;
}

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

string Sum(string& FirstInteger, string& SecondInteger)
{
	int Degit;
	string AddedZero;
	if(FirstInteger.size() < SecondInteger.size()){
		Degit = SecondInteger.size();
		for(int i = 0; i < Degit - FirstInteger.size(); i++){
			AddedZero.push_back('0');
		}
		FirstInteger = AddedZero + FirstInteger;
	}else{
		Degit = FirstInteger.size();
		for(int i = 0; i < Degit - SecondInteger.size(); i++){
			AddedZero.push_back('0');
		}
		SecondInteger = AddedZero + SecondInteger;
	}
//	cout << FirstInteger << '+' << endl << SecondInteger << endl;
	string SumInteger;
	SumInteger.resize(Degit);
	bool IsMoveUp  = false;
	bool WasMoveUp = false;
	for(int i = 0; i < Degit; i++){
		WasMoveUp = IsMoveUp;
		int Sum = WasMoveUp + FirstInteger[Degit-1-i] - '0' + SecondInteger[Degit-1-i] - '0';
		if(Sum >= 10){
			IsMoveUp = true;
			Sum -= 10;
		}else{
			IsMoveUp = false;
		}
		SumInteger[Degit-1-i] = Sum + '0';
	}
	if(IsMoveUp == true){
	    return '1' + SumInteger;
	}else{
	    return SumInteger;
	}
}

int main()
{
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		string FirstInteger, SecondInteger;
		cin >> FirstInteger >> SecondInteger;
//		cout << FirstInteger << '+' << SecondInteger << endl;
		string SumInteger = Sum(FirstInteger, SecondInteger);
//		cout << SumInteger.size() << "keta" << endl;
		if(SumInteger.size() <= 80){
//		    cout << "c" << endl;
		    cout << SumInteger.c_str() << endl;
//			cout << "b" << endl;
		}else{
			cout << "overflow" << endl;
		}
//		cout << "a" << endl;
	}
	return 0;
}