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

using namespace std;

void arrangeDigits(string &str1, string &str2){

  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  
  while(str1.size() < str2.size()){
    str1 += '0';
  }
  while(str2.size() < str1.size()){
    str2 += '0';

  // cout << "str1: " << str1 << endl;
  // cout << "str2: " << str2 << endl;
  }
}

int main(){
  int numDatasets;
  cin >> numDatasets;
  
  for(int i=0;i<numDatasets;i++){
    bool flag = false;
    string str1, str2;

    cin >> str1;
    //80????¶?????????´???
    if(str1.length() > 80){
      flag = true;
    }

    cin >> str2;
    //80????¶?????????´???
    if(str2.length() > 80){
      flag = true;
    }

    // ??????????????????
    arrangeDigits(str1, str2);
      
    //?¨????

    int c = 0;
    string res;

    // cout << str1.length() << endl;
    
    for(int i=0;i<str1.size();i++){
      int now = c + str1[i] - '0' + str2[i] -'0';
      res += now%10 + '0';
      c = now/10;
    }


      // str1.pop_back();
      // str2.pop_back();
      // cout << "----" << endl;
      // cout << "i:" << i << endl;
      // cout << (int)(str1[str1.size()-i-1]-'0') << " + " << (int)(str2[str2.size()-i-1]-'0') << endl;
      // cout << "now:" << now << endl;
      // cout << "res:" << res << endl;


    // cout << "c:" << c << endl;

    if(c){
      res += (c+'0');
    }

    if(res.size()>80){
      flag == true;
    }

    reverse(res.begin(), res.end());
    
    if(flag == false){
      cout << res << endl;
    }else{
      cout << "overflow" << endl;
    }
    
  }
}

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

int main() {
	int n;	
	std::cin >> n;
	for (int i = 0; i < n; i++) {
		int size=4;
		std::string a, b;
		std::vector<int> va, vb, out;
		std::cin >> a >> b;
		for (std::string::reverse_iterator aitr = a.rbegin(); aitr != a.rend(); aitr++) {
			va.push_back((int)*aitr - '0');
		}
		for (std::string::reverse_iterator bitr = b.rbegin(); bitr != b.rend(); bitr++) {
			vb.push_back((int)*bitr - '0');
		}
		out.push_back(0);
		size = va.size() > vb.size() ? va.size() : vb.size();
		for (int i = 0; i < size; i++) {
			out[i] = out[i] + (i < va.size() ? va[i] : 0) + (i < vb.size() ? vb[i] : 0);
			if (out[i] > 9) {
				out[i] = out[i] % 10;
				out.push_back(1);
			}
			else {
				out.push_back(0);
			}
		}
		if (out.back() == 0) out.pop_back();
		if (out.size() > 80) std::cout << "overflow" << std::endl;
		else {
			std::reverse(out.begin(), out.end());
			for (std::vector<int>::iterator itr = out.begin(); itr != out.end(); itr++) {
				std::cout << *itr;
			}
			std::cout << std::endl;
		}
	}
}

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

int main(void){
	string a,b;
	vector<int> ans;
	int n,num,ai,bi,c=0;
	bool flag;

	cin >> n;

	if(n>0&&n<=100){
		for(int i=0;i<n;i++){
			cin >> a >> b;
			flag=false;	

			for(int j=0;j<100;j++){
				num=0;
				ai=a.size()-j-1;
				bi=b.size()-j-1;
				if(ai<0&&bi<0&&c==0) break;
				if(ai>=0) num+=a[ai]-48;
				if(bi>=0) num+=b[bi]-48;
				ans.push_back((num+c)%10);
				if(num+c>=10) c=1;
				else c=0;
			}
			if(ans.size()>80){
				cout << "overflow";
			}else{
				for(int j=ans.size()-1;j>=0;--j){
					cout << ans[j];
				}
				cout << endl;
				ans.clear();
			}
		}
	}
	return 0;
}

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

int main(){
	int n;
	cin>>n;
	for(int i=0; i<n; i++){
		string a, b;
		cin>>a>>b;
		int kuri = 0;
		int k = 0;
		string ans = "";
		while(true){
			bool breakflg = true;
			int ai = 0;
			int bi = 0;
			if(int(a.size())-k-1 >= 0){
				ai = a[int(a.size())-k-1] - '0';
				breakflg = false;
			}
			if(int(b.size())-k-1 >= 0){
				bi = b[int(b.size())-k-1] - '0';
				breakflg = false;
			}
			k++;
			int sum = ai + bi + kuri;
			if(!kuri&&breakflg) break;
			if(sum>9){
				kuri = 1;
				sum %= 10;
			} else {
				kuri = 0;
			}
			ans.push_back('0'+sum);
		}
		reverse(ans.begin(), ans.end());
		cout<<ans<<endl;
	}
	return 0;
}