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 <iostream>
#include <cmath>

using namespace std;

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

	unsigned long long a, b;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		a += b;

		if (a / pow(10, 80) >= 1) {
			cout << "overflow";
		}
		else {
			cout << a;
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int f1(char c) {
	if (c == '1')return 1;
	else if (c == '2')return 2;
	else if (c == '3')return 3;
	else if (c == '4')return 4;
	else if (c == '5')return 5;
	else if (c == '6')return 6;
	else if (c == '7')return 7;
	else if (c == '8')return 8;
	else if (c == '9')return 9;
	else if (c == '0')return 0;
}
char f2(int f) {
	if (f == 1)return '1';
	else if (f == 2)return '2';
	else if (f == 3)return '3';
	else if (f == 4)return '4';
	else if (f == 5)return '5';
	else if (f == 6)return '6';
	else if (f == 7)return '7';
	else if (f == 8)return '8';
	else if (f == 9)return '9';
	else if (f == 0)return '0';
	else return 'a';
}
void solve() {
	string s, t, ans; cin >> s >> t;
	if (s.size() > t.size()) {
		string tmp = s;
		s = t;
		t = tmp;
	}
	int k = 0;
	for (int i = 1; i <= s.size(); i++){
		int p;
		p = f1(s[s.size() - i]) + f1(t[t.size() - i]) + k;
		if (p > 9) { k = 1; p -= 10; }
		else k = 0;
		ans = f2(p) + ans;
	}
	for (int i = s.size() + 1; i <= t.size(); i++){
		int p = f1(t[t.size() - i]) + k;
		if (p > 9) { k = 1; p -= 10; }
		else k = 0;
		ans = f2(p) + ans;
	}
	if (k == 1)ans = '1' + ans;
	if (ans.size() > 80)cout << "overflow";
	else cout << ans; cout << endl;
	return;
}
int main() {
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		solve();
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	int a,b;
	long long sum;
	int i;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a>>b;
		sum=(long long)a+b;
		if(sum>INT_MAX)	cout<<"overflow"<<endl;
		else	cout<<sum<<endl;
	}
	return 0;
}

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

int main() {
  int tcase;
  
  cin >> tcase;
  while(tcase--) {
    string A, B, C = "";
    cin >> A >> B;
    
    unsigned sz = max(A.size(), B.size());
    while(A.size()<sz) A = '0' + A;
    while(B.size()<sz) B = '0' + B;

    int c = 0;
    for(int i=sz-1; i>=0; i--) {
      // 確定情報
      C += (( (A[i]-'0') + (B[i]-'0') + c ) % 10 + '0');
      // 前座
      c = ( (A[i]-'0') + (B[i]-'0') + c ) / 10;
    }
    if(c>0) C += (c + '0');
    
    reverse(C.begin(), C.end());
    cout << C << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstring>
#include <algorithm>
#include <sstream>
using namespace std;

string error = "overflow";

int main(){
	ios::sync_with_stdio(false);
	cout.sync_with_stdio(false);
	int n;
	cin >> n;
	bool over[n];
	int keta[n];
	string a[n], b[n];
	char c[n][81]; 
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 81; j++){
			c[i][j] = '0';
		}
	}
	for(int i = 0; i < n; i++){
		over[i] = false;
		keta[i] = 0;
		int extra = 0;
		cin >> a[i] >> b[i];
		if(a[i].size() < b[i].size()){
			swap(a[i],b[i]);
		}
		
		for(int j = 0; j < a[i].size(); j++){
			int p, q, num;
			stringstream sa, sb, sc;
			sa << a[i][a[i].size()-j-1];
			sa >> p;
			if(j < b[i].size()){
				sb << b[i][b[i].size()-j-1];
				sb >> q;
			}
			else{
				q = 0;
			}
			if(p+q+extra < 10){
				sc << p+q+extra;
				sc >> c[i][j];
				extra = 0;
			}
			else{
				int kurai;
				kurai = (p+q+extra)%10;
				sc << kurai;
				sc >> c[i][j];
				extra = 1;
				if(j == a[i].size()-1){
					c[i][a[i].size()] = '1';
					keta[i] = 1;
				}
			}
		}
		if(c[i][80] != '0'){
			over[i] = true;
		}
	}
	for(int i = 0; i < n; i++){
		if(over[i] == true){
			cout << error;
		}
		else{
			for(int j = 0; j < a[i].size()+keta[i]; j++){
			cout << c[i][a[i].size()+keta[i]-j-1];
			}
		}
		cout << endl;
	}
}

C++: #include <iostream>
#include <sstream>
#include <cstring>

using namespace std;

int main()
{
	stringstream ss;
	string str;
	int n;
	long long num;
	
	cin >> n;
	while (n != 0){
		int sum = 0;
		for (int i = 0; i < 2; i++){
			cin >> str;
			if (str.size() > 80){
				cout << "overflow" << endl;
				break;
			}
			ss.clear();
			ss.str("");
			ss << str;
			ss >> num;
			sum += num;
		}
		cout << sum << endl;
		n--;
	}
}

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"<<endl;
        else {
                for(int j=a;j>0;j--)cout<<ans[j];
        cout<<endl;
        }
    }

}