Go: package main

import (
        "fmt"
        "math"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                var ax, ay, ar, bx, by, br float64
                fmt.Scanf("%f %f %f %f %f %f", &ax, &ay, &ar, &bx, &by, &br)

                d := math.Sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay))
                if d <= ar + br {
                        if ar > br {
                                if ar > br + d {
                                        fmt.Println("2")
                                } else {
                                        fmt.Println("1")
                                }
                        } else {
                                if br > ar + d {
                                        fmt.Println("-2")
                                } else {
                                        fmt.Println("1")
                                }
                        }
                } else {
                        fmt.Println(0)
                }
        }
}

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

int main(void){
  int N; cin >> N;
  for(int i = 0; i < N; i++){
    int ans = 0;
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double dist = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
    if(ra < rb && dist + ra < rb) ans = -2;
    else if(rb < ra && dist + rb < ra) ans = 2;
    else if(ra == rb && xa == xb && ya == yb) ans = 1;
    else if(dist > ra + rb) ans = 0;
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


double xa, ya, ra, xb, yb, rb, d;
ll n;

int main(){
	cin >> n;
	REP(i, n){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (xa == xb&&ya == yb) d = 0;
		else if (xa == xb) d = abs(ya - yb);
		else if (ya == yb) d = abs(xa - xb);
		else d = sqrt(pow(xa - xb, 2) + (ya - yb, 2));
		if (d < abs(ra - rb)){
			if (ra > rb){
				cout << 2 << endl;
			}
			else{
				cout << -2 << endl;
			}
			continue;
		}
		if (d <= ra + rb){
			cout << 1 << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
}

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

struct Point2D {
    float x, y;

    Point2D() {}
    Point2D(float ax, float ay) {
        x = ax;
        y = ay;
    }
    Point2D operator -(const Point2D &p) const {
        return Point2D(x - p.x, y - p.y);
    }
    double distance(const Point2D &p) const {
        return sqrt(pow(x - p.x, 2) + pow(y - p.y, 2));
    }
    double slope(Point2D &p) {
        return (p.x != x) ? (p.y - y) / (p.x - x) : numeric_limits<float>::infinity();
    }
    double cross(Point2D &p) { // only z
        return x * p.y - y * p.x;
    }
};

istream &operator>>(istream &is, Point2D &p) {
    is >> p.x >> p.y;
    return is;
}

ostream &operator<<(ostream &os, Point2D &p) {
    os << fixed << p.x << " " << p.y;
    return os;
}

int circles_intersection(double distance, double ra, double rb)
{
    if (distance > ra + rb)
        return 0;
    else if (distance >= abs(ra - rb))
        return 1;
    else if (ra > rb)
        return 2;
    else
        return -2;
}

int main()
{
    Point2D pa, pb;
    double ra, rb;

    int n;
    cin >> n;

    for (;n-- && cin >> pa >> ra >> pb >> rb;)
        cout << circles_intersection(pa.distance(pb), ra, rb) << endl;

    return 0;
}

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

using namespace std;

struct point {
	double x, y;
}; 

struct circle {
	double r;
	point cen;
}cirA, cirB;

double dis(point A, point B) {
	return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}

//判断&#20004;&#22278;的位置&#20851;系
//&#36755;入&#20004;&#22278;的&#22278;心坐&#26631;及半径
//&#36755;出&#20004;&#22278;的位置&#20851;系 
int solve(circle cirA, circle cirB) {
	double disAB = dis(cirA.cen, cirB.cen);
	if (disAB > cirA.r + cirB.r) return 0; //相&#31163;
	if (disAB < max(cirA.r, cirB.r)) {
		if (disAB < cirA.r) return 2; //&#22278;B在&#22278;A内
		else return -2; //&#22278;A在&#22278;B内 
	} 
	return 0; //&#20004;&#22278;相交 
}

int main() {
	int t;
	scanf ("%d", &t);
	while (t--) {
		scanf ("%lf%lf%lf%lf%lf%lf", &cirA.cen.x, &cirA.cen.y, &cirA.r, &cirB.cen.x, &cirB.cen.y, &cirB.r);
		printf ("%d\n", solve(cirA, cirB));
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int n;
double x_1, y_1, r_1, x_2, y_2, r_2;

int main() {
	scanf( "%d", &n );
	for ( int i = 0; i < n; i++ ) {
		scanf( "%lf %lf %lf %lf %lf %lf", &x_1, &y_1, &r_1, &x_2, &y_2, &r_2 );
		int ans = 0;
		double _range = sqrt( sq( x_1 - x_2 ) + sq( y_1 - y_2 ) );
		if ( _range <= r_1 + r_2 ) {
			ans = 1;
			if ( _range + r_1 <= r_2 && r_2 > r_1) {
				ans = -2;
			}
			else if ( _range + r_2 <= r_1 && r_1 > r_2) {
				ans = 2;
			}
		}
		printf( "%d\n", ans );
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int main(void)
{
    ios::sync_with_stdio(false);
    int n;
    cin >> n;

    for(int i=0; i<n; i++) {
        double ra,rb,xa,ya,xb,yb;
        cin >>ra>>xa>>ya>>rb>>xb>>yb;
        double d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));

        if(d > ra + rb) {
            cout << 0 << endl;
        } else if(d > ra - rb) {
            cout << 2 << endl;
        } else if(d > rb - ra) {
            cout << -2 << endl;
        } else {
            cout << 1 << endl;
        }
    }

    return 0;
}