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<stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
using namespace std;
int main(){
	
	int m;
	char in[2][100];
	char ans[100];
	int ie[2];
	int ien[2];
	bool max10;
	int Min;
	bool NMin;
	scanf("%d",&m);
	for(;m--;){
		
		for(int i=0;i<2;i++){
			scanf(" %s",&in[i]);
		}
		for(int i=0;i<2;i++){
			for(ie[i]=0;in[i][ie[i]]!='\0';ie[i]++){
				in[i][ie[i]]=in[i][ie[i]]-'0';
			}
		}
		ie[0]--;
		ie[1]--;
		Min=max(ie[0],ie[1]);
		if((Min>79)||((Min>78)&&(ie[0]==ie[1])&&((int(in[0][0])+int(in[1][0]))>9))){
			cout<<"overflow"<<endl;
		}else{	
			if(ie[0]>ie[1]){
				NMin=0;
			}else{
				NMin=1;
			}
			ien[0]=ie[0];
			ien[1]=ie[1];
			for(;min(ien[0],ien[1])+1;ien[0]--,ien[1]--){
				in[NMin][ien[NMin]]=in[0][ien[0]]+in[1][ien[1]];
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			max10=0;
			
			for(;ien[NMin];ien[NMin]--){
				in[NMin][ien[NMin]]=in[NMin][ien[NMin]];
				if(in[NMin][ien[NMin]+1]>9){
					in[NMin][ien[NMin]+1]-=10;
					in[NMin][ien[NMin]]  +=1;
				}
			}
			for(int i=0;i<2;i++){
				for(int j=0;j<ie[i]+1;j++){
					in[i][j]=in[i][j]+'0';
				}
			}
			if(max10) cout<<"1";
			cout<<in[NMin]<<endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

string ans;
string s1,s2;

void Calc(int up,int indx1,int indx2){


  if(indx1==-1){
    if(up!=0){ans.insert(ans.begin(),(char)(up+(int)'0'));}
    return;
  }


  if(indx2>=0){
    int work = s1[indx1]-'0' + s2[indx2]-'0' + up;

    up = work/10;
    work = work%10;

    ans.insert(ans.begin(),(char)((int)'0'+work));
  }

  else{
    int work = s1[indx1]-'0' + up;

    up = work/10;
    work = work%10;

    ans.insert(ans.begin(),(char)((int)'0'+work));
  }


  Calc(up,indx1-1,indx2-1);
}

int main(){

  char head1,head2;
  string tmp;
  int size;
  int n;


  cin >> n;

  for(int i=0; i<n; i++){
    ans="";
    cin >> s1;
    cin >> s2;
    if(s1.size()<s2.size()){ tmp=s1;s1=s2;s2=tmp; }

    if(s1.size()>=80 || s2.size()>=80)
      cout<<"overflow"<<endl;
    else if(s1.size()>=79 && s2.size()>=79 && s1[0]-'0'+s2[0]-'0'>=10)
      cout<<"overflow"<<endl;
    else{
      Calc(0,s1.size()-1,s2.size()-1);
      cout << ans << endl;
    }
  }

  return 0;
}

C++: #include <iostream>
#include <string>
??
using namespace std;
??
int main()
{
????????int num;
??
????????cin >> num;
????????for (int i = 0; i < num; i++) {
????????????????string s1, s2;
??
????????????????cin >> s1 >> s2;
????????????????if (s1.size() > 80 || s2.size() > 80)
????????????????????????cout << "overflow" << endl;
????????????????else {
????????????????????????int i1 = s1.size();
????????????????????????int i2 = s2.size();
????????????????????????string ans;
????????????????????????int tmp = 0;
????????????????????????int up = 0;
??
????????????????????????for ( ; (i1 > 0) && (i2 > 0); i1--, i2-- ) {
????????????????????????????????tmp = (s1[i1 - 1] + s2[i2 - 1]) - 2 * '0' + up;
????????????????????????????????up = tmp / 10;
????????????????????????????????tmp %= 10;
????????????????????????????????ans = char(tmp + '0') + ans;
????????????????????????}
??????????????????????????
????????????????????????if (i1 > 0) {
????????????????????????????????for ( ; i1 > 0; i1--) {
????????????????????????????????????????tmp = s1[i1 - 1] - '0' + up;
????????????????????????????????????????up = tmp / 10;
????????????????????????????????????????tmp %= 10;
????????????????????????????????????????ans = char(tmp + '0') + ans;
????????????????????????????????}
????????????????????????}
????????????????????????else if (i2 > 0) {
????????????????????????????????for ( ; i2 > 0; i2--) {
????????????????????????????????????????tmp = s2[i2 - 1] - '0' + up;
????????????????????????????????????????up = tmp / 10;
????????????????????????????????????????tmp %= 10;
????????????????????????????????????????ans = char(tmp + '0') + ans;
????????????????????????????????}
????????????????????????}
??
????????????????????????if (up > 0)
????????????????????????????????ans = char(up + '0') + ans;
??
????????????????????????if (ans.size() > 80)
????????????????????????????????cout << "overflow" << endl;
????????????????????????else
????????????????????????????????cout << ans << endl;
????????????????}
????????}
??
????????return 0;
}

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

typedef unsigned int uint;

#define max(a,b) (a>b?a:b)
#define min(a,b) (a>b?b:a)

int main() {
	string str; int c, l, n;
	vector<int> dig[2], dig2(85,0);
	cin >> n;
	while(n--) {
		for(int i=0; i<82; ++i) dig2[i] = 0;
		for(int i=0; i<2; ++i) {
			cin >> str;
			dig[i].clear();
			for(int j=(signed)str.length()-1; j>=0; --j) dig[i].push_back((int)(str[j]-'0'));
		}
		l = max(dig[0].size(), dig[1].size()); c=0;
		for(int i=0; i<l; ++i) {
			dig2[i] = (i<dig[0].size()?dig[0][i]:0)+(i<dig[1].size()?dig[1][i]:0)+c;
			c = dig2[i]/10; dig2[i] %= 10;
		}
		if(c) {dig2[l] = c; l++;}
		if(dig2[80]==0) {
			for(int i=0; i<l; ++i) cout << dig2[l-1-i];
			cout << endl;
		}else cout << "overflow" << endl;
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int N; cin >> N;
	for (int i = 0; i < N;i++) {
		string str1, str2;
		cin >> str1 >> str2;
		int f = 0;	//????????°?????????
		if (str1.length() > str2.length()) {
			string temp(str1.length() - str2.length() + 1,'0');
			str1 = '0' + str1;
			str2 = temp + str2;
		}
		else if (str1.length() < str2.length()) {
			string temp(str2.length() - str1.length() + 1, '0');
			str1 = temp + str1;
			str2 = '0' + str2;
		}
		string ans((int)str1.length(),'0');
		for (int i = str1.length()-1 ; i >= 0;i--) {
			int dig1 = str1[i] - '0', dig2 = str2[i] - '0';
			if (f + dig1 + dig2 >= 10) {
				ans[i] = (f + dig1 + dig2) % 10 +'0';
				f = 1;
			}
			else {
				ans[i] = (f + dig1 + dig2) + '0';
				f = 0;
			}
		}
		int size = ans.length();
		if (ans[0] == '0') size--;
		if (size > 80)cout << "overflow" << endl;
		else {
			if (ans[0] == '0') {
				cout << ans.substr(1) << endl;
			}
			else {
				cout << ans << endl;
			}
		}
	}
}