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 <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;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  int n;
  cin>>n;
  while(n--){
    double x,y;
    double ra,rb;
    cin>>x>>y>>ra;
    P a(x,y);
    cin>>x>>y>>rb;
    P b(x,y);
    double dist = abs(b-a);
    if(dist+ra <= rb){
      cout<<-2<<endl;
    }else if(dist+rb <= ra){
      cout<<2<<endl;
    }else if(ra+rb>=dist){
      cout<<-1<<endl;
    }else{
      cout<<0<<endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<cmath>
#include<string>
#include<algorithm>
#include<cstdlib>
using namespace std;

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

int main(){
	int n;
	scanf("%d",&n);
	for(int x=0;x<n;++x){
		circle a,b;
		scanf("%lf %lf %lf %lf %lf %lf",&a.x,&a.y,&a.r,&b.x,&b.y,&b.r);
		double d = sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
		if(d>a.r+b.r){
			cout<<0<<endl;
		}else if(a.r+d<b.r){
			cout<<-2<<endl;
		}else if(b.r+d<a.r){
			cout<<2<<endl;
		}else{
			cout<<1<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,r,n) for(int i=r;i<(int)n;i++)
using namespace std;
int in(){int x;cin>>x;return x;}
int n;
vector<int> a,b,c;

int main ()
{
	cin>>n;
	while(n--)
	{
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double half=sqrt((bx-ax)*(bx-ax)+(by-ay)*(by-ay));

		if(half-ar-br>0)
		{
			cout<<"0"<<endl;
		}
		else if(half+br<ar)cout<<2<<endl;
		else if(half+ar<br)cout<<-2<<endl;
		else cout<<1<<endl;

	}

	return 0;
}

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

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

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

struct P{
	double x, y;
};

struct Circle{
	P cp;
	double r;
};

double dist(Circle a, Circle b){
	double dx = a.cp.x - b.cp.x,
		dy = a.cp.y - b.cp.y;
	return sqrt(dx*dx+dy*dy);
}

double abs(double a){
	return (a>0)?(a):(-a);
}

int main(){
	int n;
	std::cin >> n;
	for(int i=0;i<n;i++){
		Circle a, b;
		std::cin >> a.cp.x >> a.cp.y >> a.r >> b.cp.x >> b.cp.y >> b.r;
		double d = dist(a, b),
			sum = a.r+b.r,
			diff = abs(a.r-b.r);
		if(d > a.r+b.r){//重ならない
			puts("0");
		}else if(diff <= d && d <= sum){//交わる
			puts("1");
		}else if(d < diff){//内包
			if(a.r > b.r){
				puts("2");
			}else{
				puts("-2");
			}
		}
	}
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {

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

  int n;
  
  double d,diff;
  int i;


  scanf("%d",&n);

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

    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);

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

    diff=fabs(rb-ra);

    if(d>ra+rb) printf("0\n");

    else if(d<ra+rb && d>diff) printf("1\n");

    else if(ra>rb) printf("2\n");

    else if(rb>ra) printf("-2\n");

  }

  return 0;

}

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

using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        double x1, y1, r1, x2, y2, r2, d;
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
        d = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
        
        if (r1 - r2 > d) {
            cout << 2 << endl;
        }
        else if (r2 - r1 > d){
            cout << -2 << endl;
        }
        else if (r1 + r2 < d) {
            cout << 0 << endl;
        }
        else {
            cout << 1 << endl;
        }
    }

    return 0;
}