Go: package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	dataset, _ := strconv.Atoi(sc.Text())
	var firstdata *big.Int

	for i := 0; i < dataset*2; i++ {
		n := new(big.Int)
		sc.Scan()
		data, _ := n.SetString(sc.Text(), 10)

		if i%2 == 0 {
			firstdata = data
			continue
		}

		result := new(big.Int)
		if result := result.Add(data, firstdata); len(result.String()) > 80 {
			fmt.Println("overflow")
			continue
		} else {
			fmt.Println(result)
		}
	}
}

C++: #include<iostream>
#include<string>;
using namespace std;
string Sum(string str1, string str2){
	int str1_index, str2_index, num, advance;
	string strsum;
	if(str1.size() < str2.size()){
		while(str1.size() != str2.size()) str1 = "0" + str1;
	}else if(str1.size() > str2.size()){
		while(str1.size() != str2.size()) str2 = "0" + str2;
	}
	str1_index = str1.size()-1;
	str2_index = str2.size()-1;
	advance = 0;
	while(true){
		num = (str1[str1_index] - '0') + (str2[str2_index] - '0') + advance;//????????????????£?????¶???????+??°????????°
		strsum = char( (num % 10) + '0') + strsum;//??????????????\
		//cout<<"strsum="<<strsum<<endl;
		(num >= 10)? advance=1: advance=0;
		str1_index--;
		str2_index--;
		if(str1_index<0 || str2_index<0){
			if(advance>0) strsum = "1" + strsum;
			break;
		}
	}
	return strsum;
}

int main(){
	int i, n;
	string str1,str2;
	string strsum;
	while(cin>>n){
		for(i=0;i<n;i++){
			cin>>str1;
			cin>>str2;
			
			if(str1.size()>80 || str2.size()>80){
				cout<<"overflow"<<endl;
				continue;
			}
			strsum = Sum(str1, str2);
			if(strsum.size()>80)
				cout<<"overflow"<<endl;
			else
				cout<<strsum<<endl;
		}
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
void gg(int a[],int b[],int c[])
{
    int x=0;
    //memset(c,0,sizeof(c));
    c[0]=max(a[0],b[0]);
    for(int i=1;i<=c[0];++i)
    {
        c[i]=a[i]+b[i]+x;
        x=c[i]/10;
        c[i]%=10;
    }
    if(x>0) c[++c[0]]=x;
}
int main()
{
    int t;
cin>>t;
while(t--){
    char a[1000],b[1000];
    int a2[1000],b2[1000],c2[1000];
    scanf("%s%s",a,b);
    a2[0]=strlen(a);
    b2[0]=strlen(b);
    for(int i=1;i<=a2[0];i++) a2[i]=int(a[a2[0]-i]-'0');
    for(int i=1;i<=b2[0];i++) b2[i]=int(b[b2[0]-i]-'0');
    gg(a2,b2,c2);
    if(c2[0]<=80) for(int i=c2[0];i>=1;i--) printf("%d",c2[i]);
    else printf("overflow");
    cout<<endl;
}
    return 0;
}

C++: #include <stdio.h>
#include <math.h>

using namespace std;


int main(){
	char buf1[101],buf2[101];
	bool FLG1,FLG2;
	int n,length1,length2,S1,S2,num1_index,num2_index,kuriagari=0,check1,check2;
	int output[9],num1[9],num2[9];
	scanf("%d",&n);

	for(int loop=0;loop<n;loop++){
		length1 = length2 = 0;
		scanf("%s",buf1);
		scanf("%s",buf2);
		for(int i=0; buf1[i] !='\0';i++)length1++;
		for(int i=0; buf2[i] !='\0';i++)length2++;

		if(length1 >=81 || length2 >= 81)printf("overflow\n");
		else{
			FLG1=FLG2=false;
			num1_index = num2_index = 0;
			for(int k=0;k<9;k++){
				num1[k] = num2[k] = output[k]=-1;//????????¨??????????????????
			}

			for(int k=0;k<81&&(FLG1==false||FLG2==false);){
				S1=S2=0;
				check1=check2=0;
				for(int p=0;p<9&&k<81;p++,k++){
					if(k <= length1-1){
						S1 = 10*S1 + (buf1[k] - '0');
						check1++;
					}else{
						FLG1=true; //??????
					}

					if(k <= length2-1){
						S2 = 10*S2+(buf2[k] - '0');
						check2++;
					}else{
						FLG2=true; //??????
					}
				}
				if(check1>0){
					num1[num1_index++] = S1;
				}
				if(check2>0){
					num2[num2_index++] = S2;
				}
			}

			for(int calc=0;calc<=8;calc++){
				if(num1[calc] == -1 && num2[calc] == -1){
					break;
				}else{
					output[calc] = kuriagari;
					if(num1[calc] != -1){
						output[calc] += num1[calc];
					}
					if(num2[calc] != -1){
						output[calc] += num2[calc];
					}
					if(output[calc]/1000000000 >= 1){
						kuriagari = output[calc]/1000000000;
						output[calc] %= 1000000000;
					}else{
						kuriagari = 0;
					}
				}
			}

			if(output[8]/100000000 >= 1){
				printf("overflow\n");
			}else{
				bool firstFLG=true;
				for(int show=8;show>=0;show--){
					if(output[show] != -1){
						if(firstFLG == false && output[show] < 100000000){
							printf("%09d",output[show]);
						}else{
							printf("%d",output[show]);
							firstFLG = false;
						}
					}
				}
				printf("\n");
			}
		}
	}

    return 0;
}

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

using namespace std;

void add(string &a, string &b) {
	if (a.size() > 80 || b.size() > 80) {
		cout << "overflow" << endl;
		return;
	}

	string aa = a;
	string bb = b;
	reverse(aa.begin(), aa.end());
	reverse(bb.begin(), bb.end());
	string cc;
	int carry = 0;
	int sa = a.size();
	int sb = b.size();
	int ss = sa>sb ? sa : sb;
	for (int i = 0; i < ss; i++) {
		char ca = i < sa ? aa[i] : '0';
		char cb = i < sb ? bb[i] : '0';
		char code = ca + cb + carry - '0';
		if (code > '9') {
			code -= 10;
			carry = 1;
		} else
			carry = 0;
		cc += code;
	}

	if (carry)
		cc += '1';

	if (cc.size() > 80)
		cout << "overflow" << endl;
	else {
		reverse(cc.begin(), cc.end());
		cout << cc << endl;
	}
}

int main() {
	int n;
	string a, b;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		add(a, b);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i){
		string a,b,c;
		int d=0,st;
		cin>>a>>b;
		for(int j=a.size();j<80;++j) a="0"+a;
		for(int j=b.size();j<80;++j) b="0"+b;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		for(int j=0;j<80;++j){
			c+=((a[j]-'0')+(b[j]-'0')+d)%10+'0';
			d=((a[j]-'0')+(b[j]-'0')+d)/10;
		}
		if(d) cout<<"overflow\n";
		else{
			reverse(c.begin(), c.end());
			for(st=0;;++st)if(c[st]!='0')break;
			cout<<c.substr(st,c.size()-st)<<"\n";
		}
	}
	return 0;
}

C++: n = int(input())

for i in range(n):
    a = int(input())
    b = int(input())

    print(a + b)

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

using namespace std;

int main() {
    int N;
    cin >> N;
    while(N--) {
        string s1, s2;
        cin >> s1 >> s2;

        if(s1.size() > 80 || s2.size() > 80) {
            cout << "overflow" << endl;
            continue;
        }
        char buf[81] = {0};
        int p1 = s1.size()-1, p2 = s2.size()-1, pb = 79;
        int carry = 0;
        while(p2 >= 0) buf[pb--] = s2[p2--];
        pb = 79;
        while(pb >= 0 && (p1 >= 0 || carry > 0)) {
            int bd = buf[pb];
            if(bd > 0) bd -= '0';
            int bp = 0;
            if(p1 >= 0) bp = s1[p1--]-'0';
            int d = bp + bd + carry;
            carry = d / 10;
            d %= 10;
            buf[pb--] = d+'0';
        }
        if(pb == -1 && carry > 0) cout << "overflow" << endl;
        else {
            if(carry > 0) buf[pb--] = carry+'0';
            cout << (char*)(buf+(pb+1)) << endl;
        }
    }
    return 0;
}