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 <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 <cmath>
using namespace std;

int main(){
    int n;

    cin >> n;

    for(int i=1; i<=n; i++){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));

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

    return 0;
}

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

int main() {

  long long int n;

  cin >> n;

  double xa, ya, ra, xb, yb, rb;

  for ( long long int i = 0; i < n; i++ ) {

    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    double x = xa - xb;
    x *= x;
    double y = ya - yb;
    y *= y;
    double r = ra - rb;
    r *= r;
    if ( r > x + y ) {
      if ( ra > rb ) {
	cout << 2 << endl;
      }else {
	cout << -2 << endl;
      }
    }else {
      if ( x + y > ( ra + rb ) * ( ra + rb ) ) {
	cout << 0 << endl;
      }else {
	cout << 1 << endl;
      }
    }

  }

  return 0;

}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){

	double x[2],y[2],r[2];
	for(int i=0;i<2;i++){
		cin>> x[i]>> y[i]>> r[i];
	}
	
	double d = sqrt((x[1]-x[0])*(x[1]-x[0]) + (y[1]-y[0])*(y[1]-y[0]));
	
	if(d > r[0]+r[1]){
		cout<< "0"<< endl;
		return true;
	}
	if(d < (max(r[0],r[1]) - min(r[0],r[1])) ){
		if(r[0] < r[1]){
			cout<< "-2"<< endl;
		}
		if(r[0] > r[1]){
			cout<< "2"<< endl;
		}
		return true;
	}
	cout<< "1"<<endl;
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	int n;
	cin>> n;
	for(int i=0;i<n;i++){
		solve();
	}

	return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r = pow(pow(xb - xa, (float)2.0) + pow(yb - ya, (float)2.0), (float)1.0/2);
		if (r > ra + rb) {
			cout << 0 << endl;
		}
		else if (r <ra-rb){
			cout << 2 << endl;
		}
		else if (r < rb - ra) {
			cout << -2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

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

C++: #include <bits/stdc++.h>

using namespace std;

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

C++: #include <cmath>
#include <cstdio>
#define eps 1e-8
int n; long double xa, ya, ra, xb, yb, rb;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%Lf%Lf%Lf%Lf%Lf%Lf", &xa, &ya, &ra, &xb, &yb, &rb);
		long double dist = sqrtl((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if(dist >= ra + rb - eps) {
			printf("0\n");
		}
		else if(dist <= ra - rb - eps) {
			printf("2\n");
		}
		else if(dist <= rb - ra - eps) {
			printf("-2\n");
		}
		else  {
			printf("1\n");
		}
	}
	return 0;
}

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

using namespace std;

double pa[2], pb[2];
double ra, rb;

int solve() {
  double dis = sqrt((pa[0] - pb[0]) * (pa[0] - pb[0])
                + (pa[1] - pb[1]) * (pa[1] - pb[1]));

  if (dis > ra + rb)
    return 0;
  else if (dis + ra < rb)
    return -2;
  else if (dis + rb < ra)
    return 2;
  else
    return 1;
}

int main() {
  int n;
  
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pa[0] >> pa[1] >> ra >> pb[0] >> pb[1] >> rb;
    cout << solve() << endl;
  }
  return 0;
}