Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var xa, ya, ra, xb, yb, rb float64
		fmt.Scan(&xa, &ya, &ra, &xb, &yb, &rb)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <climits>
#include <utility>

#define PRINT(STR) cout << STR << endl;
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()

typedef long long ll;

using namespace std;

int nextInt() { int n = -1; cin >> n; return n; }
double nextDouble() { double d = -1; cin >> d; return d; }
ll nextll() { ll n = -1; cin >> n; return n; }
string nextString() { string str; cin >> str; return str; }

int INF = 1LL << 25;
double EPS = 1e-9;

// BEGIN //////////////////////////////////////////////////////////////

int main() {
	int N = nextInt();
	double xa, ya, ra, xb, yb, rb;
	REP(i, N) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double distance = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (distance < ra - rb) {
			PRINT(2);
		} else {
			if (distance < rb - ra) {
				PRINT(-2);
			} else {
				if (distance <= ra + rb) {
					PRINT(1);
				} else {
					PRINT(0);
				}
			}
		}
	}
	return 0;
}

// END   //////////////////////////////////////////////////////////////

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 ) {
				ans = -2;
			}
			else if ( _range + r_2 <= r_1 ) {
				ans = 2;
			}
		}
		printf( "%d\n", ans );
	}
	return 0;
}

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

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

C++: // #0023
// Time-stamp: <2012-07-10 17:44:59 naga>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int main(){
  // (x, y) r
  double a[3],b[3];
  int n;

  cin >> n;
  while(n > 0){
    // input
    for(int i = 0; i < 3; i++){
      cin >> a[i];
    }
    for(int i = 0; i < 3; i++){
      cin >> b[i];
    }

    // distance
    double distance;
    distance = sqrt(pow(a[0] - b[0], 2) + pow(a[1] - b[1], 2));

    // judgment
    if(distance > a[2] + b[2]){
      cout << "0" << endl;
    }
    else if(distance < a[2] - b[2]){
      cout << "2" << endl;
    }
    else if(distance < b[2] - a[2]){
      cout << "-2" << endl;
    }
    else{
      cout << "1" << endl;
    }
    
    n--;
  }

  return 0;
}

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

int main() {
  double n, xa, ya, ra, xb, yb, rb;
  double x, y, xx, rr, rr2;
  cin >> n;
  while(n--) {
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    x = xb - xa; y = yb - ya;
    xx = x*x + y*y;
    rr = rb - ra; rr = rr*rr;
    rr2 = rb + ra; rr2 = rr2*rr2;
    if(xx<rr) {
      if(rb<ra) {
        cout << "2" << endl;
      }else {
        cout << "-2" << endl;
      }
    }else if(xx<=rr2 && rr<=xx) {
      cout << "1" << endl;
    }else {
      cout << "0" << endl;
    }
  }
  return 0;
}

C++: 
#include "stdafx.h"
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define roop(a,t) for(int a=0;a<t;a++) 
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	ld x[2], y[2], r[2];
	ll n;
	cin >> n;
	roop(i, n) {
		roop(lp, 2) {
			cin >> x[lp] >> y[lp] >> r[lp];
		}
		ld ab = sqrt((x[0] - x[1])*(x[0] - x[1]) + (y[0] - y[1])*(y[0] - y[1]));
		if (r[0] + r[1] < ab) { cout << 0 << endl; continue; }
		else if (r[0] + r[1] == ab) { cout << 1 << endl; continue; }
		else {
			if (r[0] > r[1]) {
				if (r[0] > r[1] + ab) { cout << 2 << endl; continue; }
			}
			else {
				if (r[1] > r[0] + ab) { cout << 2 << endl; continue; }
			}
		}cout << 1 << endl;

	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;

#define EPS 1e-8

int main(){

	int n;
	cin >> n;
	while(n--){
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d2 = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
		if(d2 > (ra + rb) * (ra + rb)) cout << 0 << endl;
		else if(d2 == (ra + rb) * (ra + rb)) cout << 1 << endl;
		else if(ra > rb) cout << 2 << endl;
		else cout << -2 << endl;
	}
	return 0;
}