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 <stdio.h>
#include <string.h>

int main(void)
{
  int N;
  scanf("%d", &N);

  int i,j,k;
  for(i=0; i<N; ++i){

    int digits[2][80];
    for(j=0; j<2; ++j){
      for(k=0; k<80; ++k){
        digits[j][k] = 0;
      }
    }

    int overflow = 0; 

    for(j=0; j<2; ++j){
      char digit[81];
      scanf("%81s", digit);
      getchar();
      
      if(overflow || strlen(digit)>80){
        overflow = 1;
      }else{
        for(k=0; k<strlen(digit); ++k){
          digits[j][k] = digit[strlen(digit)-1-k]-'0';
        }
      }
    }

    if(!overflow){
      int sum[81];
      for(j=0; j<81; ++j){
        sum[j] = 0;
      }

      for(j=0; j<80; ++j){
        for(k=0; k<2; ++k){
          sum[j] += digits[k][j];
        }
        sum[j+1] += sum[j]/10;
        sum[j] %= 10;
      }

      if(sum[80]>0){
        overflow = 1;
      }else{
        int available = 0;
        for(j=80; j>=0; --j){
          if(available || sum[j]!=0 || j==0){
            available = 1;
            printf("%d", sum[j]);
          }
        }
        printf("\n");
      }
    }

    if(overflow){
      printf("overflow\n");
    }
  }

  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;
const int N = 80;

vector<int> makeDx(string str){
    reverse(str.begin(), str.end());
    vector<int> ret(N + 100, 0);
    REP(i, str.size()) ret[i] = str[i] - '0';
    return ret;
}

int main(){
    int n; cin >>n;
    REP(z, n){
        string str[2]; cin >>str[0] >>str[1];
        vector<int> dx[2] = {makeDx(str[0]), makeDx(str[1])};
        vector<int> ans(N + 100, 0);
        bool okflg = true;
        REP(i, N){
            int sum = dx[0][i] + dx[1][i];
            ans[i] += sum;
            if(i == N - 1 && ans[i] >= 10){
                cout <<"overflow" <<endl;
                okflg = false;
            }else if(ans[i] >= 10){
                ans[i + 1] = ans[i] / 10;
                ans[i] %= 10;
            }
        }

        if(okflg){
            reverse(ans.begin(), ans.end());
            int s = 0;
            while(ans[s] == 0 && s < (N + 100) - 1) s++;
            FOR(i, s, N + 100) cout <<ans[i];
            cout <<endl;
        }
    }
    return 0;
}

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

using namespace std;

int main(void)
{
	char a[256],b[256];
	int n,flag,count1,count2,count3,daisyo=0,miss=0;
	//n:aðßéñ flag:overflowÌmF count1:aÌ count2:bÌ count3:Ì· daisyo:aÆbÌå¬ÖW
	cin>>n;

	for (int i=0; i<n; i++) 
	{
		for(int i=0;i<256;i++){
			a[i]=0;
			b[i]=0;
		}
		flag=0;
		daisyo=0;
		miss=0;

		cin>>a>>b;
		count1= strlen(a);
		count2= strlen(b);
		
		if (count1>80||count2>80) {
			flag=1;
		}
		count3=count1-count2;//Ì·
		
		if(count2>count1)
		{
			count3*=-1;//Ì·ðC³
			daisyo=1;
		}
		
		if(daisyo==0)//ªa>bÌê
		{
			if(!(count1==count2))
			for(int j=0;j<=count2;j++)
			{
				b[count2-j+count3]=b[count2-j];//bÌðaÉí¹éæ¤C³
			}
			for (int j=0; j<count3; j++) {
				b[j]='0';
			}
			
			for (int j=1; j<=count1; j++) {
				a[count1-j]+=b[count1-j]-48;
				if (((int)a[count1-j])-48>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					a[count1-j]=(a[count1-j]-48)%10+48;
					if ((count1-j)==0) {
						miss=1;
					}
					else {
							a[count1-j-1]=a[count1-j-1]+1;

						
					}
				}
			}
		}
		
		else //ªb>aÌê
		{
			for(int j=0;j<=count1;j++)
			{
				a[count1-j+count3]=a[count1-j];//bÌðaÉí¹éæ¤C³
			}
			for (int j=0; j<count3; j++) {
				a[j]='0';
			}
			
			for (int j=1; j<=count2; j++) {
				b[count2-j]+=a[count2-j]-48;
				if (((int)b[count2-j]-48)>9) 
				{
					if (j>=80) {
						flag=1;
						break;
					}
					b[count2-j]=(b[count2-j]-48)%10+48;
					if ((count2-j)==0) {
						miss=1;
					}
					else {
						b[count2-j-1]=b[count2-j-1]+1;
					}
				}
			}
		}
		
		if(flag==1)
		{
			cout << "overflow" << endl;
		}
		
		else 
		{
			if (miss==1) {
				cout << '1';
			}
			if(daisyo==0) 
			{
				for (int j=0; j<count1; j++) 
				{
					cout << (int)a[j]-48;
				}
			}
			
			else 
			{
				for (int j=0; j<count2; j++) 
				{
					cout << (int)b[j]-48;
				}
			}
			cout << endl;

		}
		
		
	}
		
		
	
	return (0);
}