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 <iostream>
#include <cstdio>
#include <complex>

using namespace std;
typedef long long ll;

typedef double R;
typedef complex<R> P;

R cross(const P &a, const P &b) { return imag(conj(a)*b); }
R dot(const P &a, const P &b) { return real(conj(a)*b); }

struct C {
    P p;
    R r;
    C () {};
    C (P p, R r) : p(p), r(r) {};
};

C c[2];
int solve() {
    for (int i = 0; i < 2; i++) {
        R x, y, r;
        cin >> x >> y >> r;
        c[i] = C(P(x, y), r);
    }
    R dist = abs(c[0].p - c[1].p);
    if (c[0].r > c[1].r + dist) return 2;
    if (c[1].r > c[0].r + dist) return -2;
    if (c[0].r + c[1].r >= dist) return 1;
    return 0;
}


int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cout << solve() << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#define EPS 0.000000001
using namespace std;

double X[2][60],Y[2][60],R[2][60];
int res[60];
int main(){
	int N;
	cin>>N;
	for(int i=1;i<=N;i++){
		for(int j=0;j<2;j++){
			cin>>X[j][i]>>Y[j][i]>>R[j][i];
		}
	}

	double re;
	for(int i=1;i<=N;i++){
		re=pow(X[0][i]-X[1][i],2)+pow(Y[0][i]-Y[1][i],2);
		if(re>pow(R[0][i]+R[1][i],2)){
			res[i]=0;
		}
		else if(re>=pow(R[0][i]-R[1][i],2)){
			res[i]=1;
		}
		else if(R[0][i]>R[1][i]){
			res[i]=2;
		}
		else res[i]=-2;
	}
	for(int i=1;i<=N;i++){
		cout<<res[i]<<endl;
	}
	return 0;
}

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

int main(void){
	int i,j,n;
	double d,c[2][3];

	cin>>n;
	while(n--){
		for(i=0;i<2;i++) for(j=0;j<3;j++) cin>>c[i][j];

		d = sqrt( pow( c[1][0] - c[0][0], 2 ) + pow( c[1][1] - c[0][1], 2 ) );

		if(c[0][2] <= c[1][2] && d + c[0][2] < c[1][2]){
			cout<<"-2\n";
		}
		else if(c[0][2] >= c[1][2] && d + c[1][2] < c[0][2]){
			cout<<"2\n";
		}
		else if(d > c[0][2] + c[1][2]){
			cout<<"0\n";
		}
		else{
			cout<<"1\n";
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (((ll)1<<31)-1)
#define eps LDBL_EPSILON
#define moder (1000000007)
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
#define ggr getchar();getchar();return 0;
using namespace std;
int n;
long double a,b,c,d,e,f;
signed main(){
	cin>>n;
	rep(i,n){
		cin>>a>>b>>c>>d>>e>>f;
		if(hypot(a-d,b-e)>c+f)cout<<0<<endl;
		else if(hypot(a-d,b-e)<c-f)cout<<2<<endl;
		else if(hypot(a-d,b-e)<f-c)cout<<-2<<endl;
		else cout<<1<<endl;
	}
	return 0;
}

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

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

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(l2 < ( ra - rb )*( ra - rb ) && rb < ra)
			{
				cout << 2 << endl;
			} else if(l2 < ( rb - ra )*( rb - ra ) && ra < rb)
			{
				cout << -2 << endl;
			} else
			{
				cout << 1 << endl;
			}
		}
	}
}

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

float d(float x, float y, float z, float w){
	float ret;
	ret = pow(x *1000 - z * 1000, 2) + pow(y * 1000 - w * 1000, 2);
	return sqrtf(ret);
}

int main(){
	int n;
	float x[2], y[2], r[2], dd;
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dd = d(x[0], y[0], x[1], y[1]);
		if(dd > (r[0]+r[1]) * 1000){
			cout << 0 << endl;
		}
		else if(dd + r[0] * 1000 <= r[1] * 1000){
			cout << -2 << endl;
		}
		else if (dd + r[1] * 1000 <= r[0] * 1000) {
			cout << 2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

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

int main(){
	double xa, ya, ra, xb, yb, rb, d;
	int n;

	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
		d = sqrt(d);
		if(ra > rb){
			if(d < ra - rb) cout << "2" << endl;
			else if(d == ra - rb || d == ra + rb) cout << "1";
			else cout << "0" << endl;
		}else {
			if(d < rb - ra) cout << "-2" << endl;
			else if(d == rb - ra || d == ra + rb) cout << "1" << endl;
			else cout << "0" << endl;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  int n; scanf("%d",&n);
  while(n --> 0){
    P c1, c2; double r1, r2;
    scanf("%lf%lf%lf%lf%lf%lf",&c1.real(),&c1.imag(),&r1,&c2.real(),&c2.imag(),&r2);
    double dist = abs(c1 - c2);
    if(r1 > dist + r2) puts("2");
    else if(r2 > dist + r2) puts("-2");
    else if(r1 + r2 + EPS >= dist) puts("1");
    else puts("0");
  }
  return 0;
}

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

double dist(double xa, double ya, double xb, double yb)
{
    return sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
}

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

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

        double d = dist(xa, ya, xb, yb);
        if (d > ra + rb) std::cout << "0\n";
        else {
            if (d < ra) std::cout << "2\n";
            else if (d < rb) std::cout << "-2\n";
            else std::cout << "1\n";
        }
    }
}

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

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