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<iostream>
#include<math.h>
#include<algorithm>
#include<string>
using namespace std;

int main() {
	int n;
	cin >> n;
	for(int k = 0; k < n; k++) {
		string str1, str2;
		cin >> str1 >> str2;
		int a = str1.size(), b = str2.size();
		if(a > 80 || b > 80) {
			cout << "overflow" <<endl;
		} else if(a >= b) {
			for(int i = 0; i < b; i++) {
				str1[a - b + i] += str2[i] - '0';
				for(int i = a - 1; i >= 0; i--) {
					if(str1[i] > '9') {                 //?????????//
						if(i != 0) {
							str1[i] = str1[i] - ':' + '0';
							str1[i - 1] = str1[i - 1] + 1;
						}
					}
				}
			}
			if(a == 80 && str1[0] > '9') {
				cout << "overflow" <<endl;
			} else {
				for (int j = 0; j < a; j++) {
					if(str1[j] > '9') {
						printf("%d",str1[j] - '0');
					} else cout<< str1[j];
				}
				cout <<endl;
			}
		} else if(b > a) {
			for(int i = 0; i < a; i++) {
				str2[b - a + i] += str1[i] - '0';
				for(int i = b - 1; i >= 0; i--) {
					if(str2[i] > '9') {                    //?????????//
						if(i != 0) {
							str2[i] = str2[i] - ':' + '0';
							str2[i - 1] = str2[i - 1] + 1;
						}
					}
				}
			}
			if(b == 80 && str2[0] > '9') {
					cout << "overflow" <<endl;
			} else {
				for (int j = 0; j < b; j++) { 
					if(str2[j] > '9') {
						printf("%d",str2[j] - '0');
					} else cout << str2[j];
				}
				cout << endl;
			}
		}
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	double x = 0, y = 0, rad = 90 * M_PI / 180;
	int a, b;
	while (scanf("%d,%d", &a, &b) && (a || b)) {
		x += a*cos(rad);
		y += a*sin(rad);
		//????????????
		rad -= b*M_PI / 180;
	}
	cout << (int)x << endl << (int)y << endl;
	return 0;
}

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


int main(){
  int n,i,j;
  string a,b;
  int sum[110]={};
  int up = 0;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a >> b;
    int sa=a.size(),sb=b.size();
    int flag=0;
    if(sa>=80||sb>=80) flag =1;
    for(j=0;j<max(sa,sb);j++){
      if(sa>j&&sb>j){
	sum[j] = (a[sa-j-1]-'0') + (b[sb-j-1]-'0') + up;
      }else if(sa>j){
	sum[j] = (a[sa-j-1]-'0') + up;
      }else if(sb>j){
	sum[j] = (b[sb-j-1]-'0') + up;
      }
      up=0;
      if(sum[j]>9){
	up=1;
	sum[j]-=10;
      }
    }
    sum[max(sa,sb)]=up;
    int k=110-1;
    while(sum[k]==0&&k>0) k--;
    if(k>=80||flag==1) cout << "overflow";
    else
    for(j=k;j>=0;j--)
      cout << sum[j];
    cout << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
#define repeat(i,n) for (int i = 0; i < (n); ++i)
#define MAX_DIGIT (80)
int main() {
    int N; cin >> N;
    repeat (test,N) {
        int d[MAX_DIGIT+1]; fill(d,d+MAX_DIGIT+1,0);
        repeat (i,2) {
            string s; cin >> s;
            if (80 < s.length()) {
                cout << "overflow" << endl;
                if (i == 0) cin >> s;
                goto next;
            }
            repeat (j,(int)s.length()) {
                d[j] += s[s.length()-1-j] - '0';
            }
        }
        repeat (i,MAX_DIGIT) {
            d[i+1] += d[i] / 10;
            d[i] %= 10;
        }
        if (d[MAX_DIGIT] != 0) {
            cout << "overflow" << endl;
        } else {
            int i = MAX_DIGIT;
            while (d[i] == 0) -- i;
            for (; 0 <= i; --i) cout << d[i];
            cout << endl;
        }
next: ;
    }
    return 0;
}

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

int main(void) {
	string str1, str2;
	int i1, i2;	
	vector<char> v;
	vector<char>::iterator it;
	int n; 
	cin >> n;
	while (n--) {
		cin >> str1 >> str2;
		if (str1.length() > 80 || str2.length() > 80) {
			cout << "overflow\n"; 
			continue;
		}
		int up = 0, n1, n2;
		char c;
		v.clear();
		if (str1.length() < str2.length())
			swap(str1, str2);
		for (i1 = str1.length() - 1, i2 = str2.length() - 1;
				i2 >= 0; i1--, i2--) {
			n1 = str1[i1] - '0';
			n2 = str2[i2] - '0';
			n1 = n1 + n2 + up;
			up = n1 / 10;
			n1 = n1 % 10;
			c = (char)(n1 + '0');
			v.push_back(c);
		}
		while (i1 >= 0) {
			n1 = str1[i1] - '0';
			n1 = n1 + up;
			up = n1 / 10;
			n1 = n1 % 10;
			c = (char)(n1 + '0');
			v.push_back(c);
			i1--;
		}
		if (up == 1) {
			v.push_back('1');
		}
		if (v.size() > 80) {
			cout << "overflow" << endl;
			continue;
		}
		reverse(v.begin(), v.end());
		for (it = v.begin(); it != v.end(); it++) {
			cout << *it;
		}
		cout << endl;
	}
}