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 <algorithm>
#include <cstdio>
#include <stack>
using namespace std;

int main(){
  stack<int> n1,n2;
  int n,nn1,nn2,up,k,f,num[1000];
  char c;
  cin>>n;
  scanf("%c",&c);
  for(int i=0;i<n;i++){
    while(1){
      scanf("%c",&c);
      if(c=='\n')break;
      n1.push(c-'0');
    }
    while(1){
      scanf("%c",&c);
      if(c=='\n')break;
      n2.push(c-'0');
    }
    up=0;
    k=0;
    f=0;
    while(1){
      if(n1.size()!=0){
	nn1=n1.top();n1.pop();
      }else nn1=0;
      if(n2.size()!=0){
	nn2=n2.top();n2.pop();
      }else nn2=0;
      num[k]=(nn1+nn2+up)%10;
      up=(nn1+nn2+up)/10;
      if(n1.size()==0&&n2.size()==0&&up==0){
	break;
      }
      k++;
      if(k>=80)f=1;
    }
    if(f==1)cout<<"overflow";
    else {
      for(int i=k;i>=0;i--)cout<<num[i];
    }
    cout<<endl;
  }
  return 0;
}

C++: #include<iostream>
int main(){
int n;
cin>>n;
while(n--){
    long long int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
}
}

C++: #include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a;
cin>>a;
for(int b=0;b<a;b++){
    int goukei[81]{};
    char c[110]{},d[110]{};
    scanf("%s%s",c,d);
    int e,f;
    e=strlen(c);f=strlen(d);
    if(e>80||f>80)puts("overflow");
   else{ e--;f--;
    for(int g=80;g!=0;g--,e--,f--){
	int s=goukei[g];
	if(e>-1)s+=c[e]-48;
	if(f>-1)s+=d[f]-48;
	goukei[g-1]=s/10;
	goukei[g]=s%10;
	}
	if(goukei[0])puts("overflow");
	else{
	    bool ss=false;
	    for(int m:goukei){
		if(m)ss=true;
		if(ss)printf("%d",m);
		}
		puts("");
	    }}
    }
}

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

int main()
{
	int n;
	cin >> n;
	
	for(int j = 0; j < n; ++j)
	{
		string numA;
		string numB;
		cin >> numA >> numB;
		/*
		if(numA.size()<numB.size())swap(numA,numB);
		while(numA.size()>numB.size())numB="0"+numB;
		*/
		while(numA.size() != numB.size())
		{
			if(numA.size() < numB.size())
			{
				numA = "0" + numA;
			}
			else
			{
				numB = "0" + numB;
			}
		}
		
		numA = "0" + numA;
		numB = "0" + numB;
		
		for(int i = numA.size() - 1; i >= 0; --i)
		{
			int sum = 0;
			sum = (numA[i] - '0') + (numB[i] - '0');
			
			if(sum >= 10)
			{
				sum -= 10;
				numA[i - 1] += 1;
			}
			
			numA[i] = sum + '0';
		}
		
		if(numA.size() > 80)
		{
			cout << "overflow" << endl;
			continue;
		}
		if(numA.size() == 80 && numA[0] != '0')
		{
			cout << "overflow" << endl;
			continue;
		}
		
		for(int i = 0; i < numA.size(); ++i)
		{
			if(i == 0 && numA[i] == '0') continue;
			cout << numA[i];
		}
		
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>;
using namespace std;
string Sum(string str1, string str2){
	int str1_index, str2_index, num, advance;
	string strsum;
	if(str1.size() < str2.size()){
		while(str1.size() != str2.size()) str1 = "0" + str1;
	}else if(str1.size() > str2.size()){
		while(str1.size() != str2.size()) str2 = "0" + str2;
	}
	str1_index = str1.size()-1;
	str2_index = str2.size()-1;
	advance = 0;
	while(true){
		num = (str1[str1_index] - '0') + (str2[str2_index] - '0') + advance;//????????????????£?????¶???????+??°????????°
		strsum = char( (num % 10) + '0') + strsum;//??????????????\
		//cout<<"strsum="<<strsum<<endl;
		(num >= 10)? advance=1: advance=0;
		str1_index--;
		str2_index--;
		if(str1_index<0 || str2_index<0){
			if(advance>0) strsum = "1" + strsum;
			break;
		}
	}
	return strsum;
}

int main(){
	int i, n;
	string str1,str2;
	string strsum;
	while(cin>>n){
		for(i=0;i<n;i++){
			cin>>str1;
			cin>>str2;
			
			if(str1.size()>80 || str2.size()>80){
				cout<<"overflow"<<endl;
				continue;
			}
			strsum = Sum(str1, str2);
			if(strsum.size()>80)
				cout<<"overflow"<<endl;
			else
				cout<<strsum<<endl;
		}
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
void gg(int a[],int b[],int c[])
{
    int x=0;
    //memset(c,0,sizeof(c));
    c[0]=max(a[0],b[0]);
    for(int i=1;i<=c[0];++i)
    {
        c[i]=a[i]+b[i]+x;
        x=c[i]/10;
        c[i]%=10;
    }
    if(x>0) c[++c[0]]=x;
}
int main()
{
    int t;
cin>>t;
while(t--){
    char a[1000],b[1000];
    int a2[1000],b2[1000],c2[1000];
    scanf("%s%s",a,b);
    a2[0]=strlen(a);
    b2[0]=strlen(b);
    for(int i=1;i<=a2[0];i++) a2[i]=int(a[a2[0]-i]-'0');
    for(int i=1;i<=b2[0];i++) b2[i]=int(b[b2[0]-i]-'0');
    gg(a2,b2,c2);
    if(c2[0]<=80) for(int i=c2[0];i>=1;i--) printf("%d",c2[i]);
    else printf("overflow");
    cout<<endl;
}
    return 0;
}