Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	const maxCapacity = 512 * 1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)

	n := nextInt()
	maxint, _ := new(big.Int).SetString("100000000000000000000000000000000000000000000000000000000000000000000000000000000", 10)

	for i := 0; i < n; i++ {
		aStr := nextString()
		bStr := nextString()

		a, _ := new(big.Int).SetString(aStr, 10)
		b, _ := new(big.Int).SetString(bStr, 10)
		c := big.NewInt(0).Add(a, b)

		if c.Cmp(maxint) < 0 {
			fmt.Println(c)
		} else {
			fmt.Println("overflow")
		}
	}
}

C++: #include <iterator>
#include <typeinfo>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
ll mod = 1e9 + 7;
string Addition(string a,string b) {
	string ans = "";
	int bef = 0;
	int be1 = 0;
	for (int i = a.length() - 1; i >= 0; i--) {
		int added = stoi(a.substr(i, 1)) + stoi(b.substr(i, 1))+be1;

		if (added >= 10) {
			bef = 1;
			added -= 10;
		}
		else {
			bef = 0;
		}

		ans = to_string(added)+ans;
		if (i == 0) 
		{
			break;
		}
		be1 = bef;
	}
	if (be1 == 1) {
		ans = "1" + ans;
	}
	return ans;
}
int main() {
	int n;
	cin >> n;
	rep(o1, n) {
		string a, b;
		cin >> a >> b;
		if (a.length() < b.length()) {
			swap(a, b);
		}
		string b1 = b;
		for (int i = 0; i < a.length() - b1.length(); ++i) {
			b = '0' + b;
		}
		string ans = Addition(a, b);
		if (ans.length() > 80) { cout << "overflow" << endl; }
		else {
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        int prime[n+1];
        for(int i=0;i<=n;i++)
            prime[i]=1;
            prime[0]=0;
            prime[1]=0;
        for(int i=2;i*i<=n;i++)
             if(prime[i]==1)
        {
            for(int j=2;j*i<=n;j++)
            prime[i*j]=0;
        }
        int c=0;
        for(int i=0;i<=n;i++)
        {
            if(prime[i]==1)
                c++;
        }
        printf("%d\n",c);
    }

}

C++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>

using namespace std;

const size_t opsize = 81, bufsize = 102;
unsigned char op1[opsize], op2[opsize];
char buf[bufsize];

bool readOp(unsigned char * op){
    memset(op, 0, opsize);
    
    fgets(buf, bufsize, stdin);
    int l = strlen(buf);
    if(l > 81) return true;

    char *p = &buf[l-2];
    for (int j = 0; j < l-1; j++) {
        op[j] = *p - '0';
        p--;
    }
    return false;
}

void printOp(unsigned char * op){
    int mh = opsize - 1;
    while(op[mh] == 0 && mh > 0) mh--;
    for(; mh >= 0; mh--){
        putchar(op[mh] + '0');
    }
    putchar('\n');
}

void plus(){
    for (int i = 0; i < opsize - 1; i++) {
        op1[i] += op2[i];
        if(op1[i] >= 10){
            op1[i] -= 10;
            op1[i+1] += 1;
        }
    }
}

int main(int argc, char const* argv[])
{
    int n;
    scanf("%d ", &n);
    for (int i = 0; i < n; i++) {
        bool overflow = false;
        overflow |= readOp(op1);
        overflow |= readOp(op2);
        if(overflow){
            puts("overflow");
            continue;
        }
        plus();
        printOp(op1);
    }
    
    return 0;
}

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

using namespace std;

int main()
{
	string str1, str2, ans;
	int n;

	cin >> n;

	for (int i=0; i<n; i++)
	{
		bool cryflag = false,	//trueのとき繰り上がり
		     overflag = false;	//trueのときoverflow
		ans.clear();
		cin >> str1 >> str2;

		int len1 = str1.size(), len2 = str2.size();

		for (int j=0, k=0; j<len1 || k<len2; j++, k++) {
			int c1 = 0, c2 = 0, c;

			if(j < len1)
				c1 = str1[len1-j-1] - '0';
			if(k < len2)
				c2 = str2[len2-k-1] - '0';

			//cout << len1 << len2;	//Debug

			c = c1 + c2;

			if(cryflag) {
				c++;
				cryflag = false;
			}

			if(c>=10)	cryflag = true;

			ans += c%10 + '0';

			//cout << len1 << len2;	//Debug

			if(ans.size() > 80 || (ans.size() == 80 && cryflag))	{
				overflag = true;
				break;
			}
		}

		if(overflag) {
			cout << "overflow";
		}
		else {
			if(cryflag)	cout << "1";
			for (int i=0; i<(int)ans.size(); i++) {
				cout << ans[ans.size()-i-1];
			}
		}

		cout << endl;
	}

	return 0;
}

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

using namespace std;

int main(void) {
	int sets;
	char input1[100], input2[100], out[100];
	int i1, i2, o, carry;
	int ic1, ic2;
	int i;

	cin >> sets;
	for(i=0;i<sets;i++) {
		scanf("%s", input1);
		scanf("%s", input2);
		for(i1=0;input1[i1] != '\0';i1++);
		for(i2=0;input2[i2] != '\0';i2++);
		i1--;i2--;o=0;carry=0;
		while(i1>=0 || i2>=0 || carry) {
			if(o > 80) { break; }
			if(i1>=0) { ic1 = input1[i1]-'0'; i1--; } else { ic1 = 0; }
			if(i2>=0) { ic2 = input2[i2]-'0'; i2--; } else { ic2 = 0; }
			if( ic1+ic2+carry < 10 ) { 
				out[o] = ic1+ic2+carry+'0';
				carry = 0;
			} else {
				out[o] = ic1+ic2+carry-10+'0';
				carry = 1;
			}
			o++;
		}
		if(o > 80) { printf("overflow"); }
		else { for(o--;o>=0;o--) { printf("%c", out[o]); } }
		printf("\n"); 
	}

	return 0;
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
 
 int main()
 {
   int N;
   cin>>N;
   while(N--)
   {
     string a,b,sum;
     cin>>a>>b;
     bool flag=false;
     if(a.length()>=80||b.length()>=80) flag=true;
     else
     {
       int up=0;
       int i;
       for(int j=0;j<a.length()/2;j++) swap(a[j],a[a.length()-j-1]);
       for(int j=0;j<b.length()/2;j++) swap(b[j],b[b.length()-j-1]);
       for(i=0;i<a.length()&&i<b.length();i++)
       {
         sum+=(((a[i]-'0')+(b[i]-'0')+up)%10)+'0'; 
         if(a[i]-'0'+b[i]-'0'+up>=10) up=1;   
         else up=0;  
       }          
       while(i<a.length()) 
       {
         sum+=((a[i]-'0'+up)%10)+'0';
         if(a[i]-'0'+up>=10) up=1; 
         else up=0;         
         i++;          
       }
       while(i<b.length()) 
       {
         sum+=((b[i]-'0'+up)%10)+'0';
         if(b[i]-'0'+up>=10) up=1; 
         else up=0;
         i++;                   
       }
       if(up==1) sum+='1';
       if(sum.length()>=80) flag=true;
     }
     if(flag) cout<<"overflow"<<endl;
     else
     {
       for(int i=sum.length()-1;i>=0;i--) cout<<sum[i];
       cout<<endl;    
     }
   }
   //while(1);      
   return 0;    
 }