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)
		// println(xa, ya, ra, xb, yb, rb)
		dis := math.Sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
		if dis + ra < rb {
			fmt.Println(-2)
		} else if dis + rb < ra {
			fmt.Println(2)
		} else if dis > rb + ra {
			fmt.Println(0)
		} else {
			fmt.Println(1)
		}
	}
}

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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )

#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

const double EPS = 1e-8;

struct Point
{
	double x, y;

	Point() : x( 0 ), y( 0 ) {}
	Point( const double x, const double y ) : x( x ), y( y ) {}
	Point( const Point &a ) : x( a.x ), y( a.y ) {}
	
	const Point operator + ( const Point &a ) const
	{
		return Point( x + a.x, y + a.y );
	}

	Point& operator += ( const Point &a ) 
	{
		x += a.x;
		y += a.y;

		return *this;
	}

	const Point operator - ( const Point &a ) const
	{
		return Point( x + ( -a.x ), y + ( -a.y ) );
	}

	Point& operator -= ( const Point &a )
	{
		x -= a.x;
		y -= a.y;

		return *this;
	}

	const Point operator * ( const double a ) const
	{
		return Point( x * a, y * a );
	}

	Point& operator *= ( const double a )
	{
		x *= a;
		y *= a;

		return *this;
	}

	const Point operator / ( const double a ) const
	{
		return Point( x / a, y / a );
	}

	Point& operator /= ( const double a )
	{
		x /= a;
		y /= a;

		return *this;
	}

	bool operator < ( const Point &a ) const
	{
		return x == a.x ? y < a.y : x < a.x;
	}

	double abs() const
	{
		return sqrt( pow( x, 2. ) + pow( y, 2. ) );
	}

	const Point unitVector() const
	{
		return *this / abs();
	}

	const Point normalVector1() const
	{
		return Point( y, -x );
	}

	const Point normalVector2() const
	{
		return Point( -y, x );
	}
};

bool eq( const double a, const double b )
{
	return abs( a - b ) <= EPS;
}

// 二点間の距離
double distance( const Point &a, const Point &b )
{
	return ( a - b ).abs();
}

int circles_intersect( const Point &p1, const double r1, const Point &p2, const double r2 )
{
	if ( eq( p1.x, p2.x ) && eq( p1.y, p2.y ) && eq( r1, r2 ) )
	{
		return 3;
	}

	const double dist = distance( p1, p2 );
	if ( r1 + r2 + EPS < dist )
	{
		return 0;
	}
	else if ( eq( r1 + r2, dist ) )
	{
		return 1;
	}
	else if ( abs( r1 - r2 ) + EPS < dist && dist + EPS < r1 + r2 )
	{
		return 2;
	}
	else if ( dist + EPS <  abs( r1 - r2 ) )
	{
		return r1 < r2 ? 20 : 10;
	}
	else if ( eq( abs( r1 - r2 ), dist ) )
	{
		return r1 < r2 ? 21 : 11;
	}
	return -1;
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );
	
	int n;
	cin >> n;

	REP( casenum, 0, n )
	{
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		int res = circles_intersect( Point( xa, ya ), ra, Point( xb, yb ), rb );
		
		switch ( res )
		{
			case 0:
				cout << 0 << endl;
				break;
			case 10:
				cout << 2 << endl;
				break;
			case 20:
				cout << -2 << endl;
				break;
			default:
				cout << 1 << endl;
				break;
		}
	}

	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
#define MAX_N 5001
#define EPS 1e-10

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

#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) + pow(ya - yb, 2));

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((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 dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist)
			cout<<0<<endl;
		// ~üªðíé
		else if(EQ(abs(ra-rb)*abs(ra-rb),dist)||(abs(ra-rb))*(abs(ra-rb))<dist)
			cout<<1<<endl;
		else if(abs(ra-rb)*abs(ra-rb)>dist){
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
		}
		else
			cout<<1<<endl;
	}

	return 0;
}

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


int main(){
  int n;
  cin >> n;

  for(int i=0; i<n; i++){
    double x1, y1, x2, y2, r1, r2;
    cin >> x1 >> y1 >> r1 >> x2 >>y2 >> r2;

    double d = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));

    if(d > r1 + r2){
      cout << 0 << endl;
    } else if(abs(r1-r2) <= d && d <= r1 + r2){
      cout << 1 << endl;
    } else if(d < abs(r1-r2)){
      if(r1 > r2){
        cout << 2 << endl;
      } else {
        cout << -2 << endl;
      }
    }
  }
}

C++: #include<iostream>
#include<vector>
#include<cmath>
using namespace std;
struct circle {
	double x;
	double y;
	double r;
};
int main() {
	enum ins{A_isin_B,B_isin_A,Intersect,isnot};
	vector<ins>l;
	circle c1, c2;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> c1.x >> c1.y >> c1.r >> c2.x >> c2.y >> c2.r;
		double dis = sqrt((c2.x - c1.x)*(c2.x - c1.x) + (c2.y - c1.y)*(c2.y - c1.y));
		if (c1.r + c2.r < dis)l.push_back(isnot);
		else if (dis + c1.r <= c2.r)l.push_back(A_isin_B);
		else if (dis + c2.r <= c1.r)l.push_back(B_isin_A);
		else l.push_back(Intersect);
	}
	for (ins i : l) {
		if (i == A_isin_B)cout << -2;
		else if (i == B_isin_A)cout << 2;
		else if (i == isnot)cout << 0;
		else cout << 1;
		cout << endl;
	}
}