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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

struct Circle
{
	double x, y, r;
};

int main()
{
	int n;
	cin >> n;
	
	rep(i, n)
	{
		Circle a, b;
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;

		double d = sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));

		if(a.r + b.r < d)
			cout << 0 << endl;
		else if(d < a.r - b.r)
			cout << 2 << endl;
		else if(d < b.r - a.r)
			cout << -2 << endl;
		else
			cout << 1 << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>

using namespace std;

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

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		double d = abs(ax-bx)*abs(ax-bx) + abs(ay-by)*abs(ay-by);
		d = sqrt(d);
		if (d + rb < ra) {
		  cout<<2<<endl;
		} else if (d + ra < rb) {
		  cout<<-2<<endl;
		} else if (d <= ra + rb) {
		  cout<<1<<endl;
		} else {
		  cout<<0<<endl;
		}
	}
	return 0;
}

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 << 3 << endl;
				break;
		}
	}

	return 0;
}