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 <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int n;
double xa, ya, ra, xb, yb, rb;
bool doswap = false;

double dist(double x1, double x2, double y1, double y2) {
	double dx = xa - xb;
	double dy = ya - yb;
	return sqrt(dx*dx + dy*dy);
}

void swap(double *arg1, double *arg2) {
	double tmp = *arg1;
	*arg1 = *arg2;
	*arg2 = tmp;
}

int main() {
	cin >> n;

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

		doswap = false;

		if (ra < rb) {
			swap(&xa, &xb);
			swap(&ya, &yb);
			swap(&ra, &rb);
			doswap = true;
		}

		double dist_ab = dist(xa, ya, xb, yb);

		if (dist_ab < ra) {
			if (dist_ab + rb < ra) {
				if (doswap) cout << "-2" << endl;
				else cout << "2" << endl;
			}
			else cout << "1" << endl;
		} else if (dist_ab < rb) cout << "1" << endl;
		else if (dist_ab < ra + rb) cout << "1" << endl;
		else cout << "0" << endl;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

C++: #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>

#define REP(i,s,e) for(int i=int(s);i<int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define EPS 1e-9

using namespace std;

int main(){

	int n;
	cin >>n;

	double xa,ya,ra,xb,yb,rb;
	rep(i,n){

	cin >> xa >> ya >> ra >> xb >> yb >> rb;

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

	if(AB>ra+rb) cout << 0 << endl;
	else if(AB<ra-rb) cout << 2 << endl;
	else if(AB<rb-ra) cout << -2 << endl;
	else  cout << 1 << endl;
	}


return 0;
}

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

using namespace std;

struct point {
	double x, y;
}; 

struct circle {
	double r;
	point cen;
}cirA, cirB;

double dis(point A, point B) {
	return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}

//判断&#20004;&#22278;的位置&#20851;系
//&#36755;入&#20004;&#22278;的&#22278;心坐&#26631;及半径
//&#36755;出&#20004;&#22278;的位置&#20851;系 
int solve(circle cirA, circle cirB) {
	double disAB = dis(cirA.cen, cirB.cen);
	if (disAB > cirA.r + cirB.r) return 0; //相&#31163;
	if (disAB < max(cirA.r, cirB.r)) {
		if (disAB < cirA.r) return 2; //&#22278;B在&#22278;A内
		else return -2; //&#22278;A在&#22278;B内 
	} 
	return 1; //&#20004;&#22278;相交 
}

int main() {
	int t;
	scanf ("%d", &t);
	while (t--) {
		scanf ("%lf%lf%lf%lf%lf%lf", &cirA.cen.x, &cirA.cen.y, &cirA.r, &cirB.cen.x, &cirB.cen.y, &cirB.r);
		printf ("%d\n", solve(cirA, cirB));
	}
	return 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 <cmath>
using namespace std;

int main(){
    int n;

    cin >> n;

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

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

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

    return 0;
}

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

int main() {

  long long int n;

  cin >> n;

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

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

    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    double x = xa - xb;
    x *= x;
    double y = ya - yb;
    y *= y;
    double r = ra - rb;
    r *= r;
    if ( r > x + y ) {
      if ( ra > rb ) {
	cout << 2 << endl;
      }else {
	cout << -2 << endl;
      }
    }else {
      if ( x + y > ( ra + rb ) * ( ra + rb ) ) {
	cout << 0 << endl;
      }else {
	cout << 1 << endl;
      }
    }

  }

  return 0;

}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){

	double x[2],y[2],r[2];
	for(int i=0;i<2;i++){
		cin>> x[i]>> y[i]>> r[i];
	}
	
	double d = sqrt((x[1]-x[0])*(x[1]-x[0]) + (y[1]-y[0])*(y[1]-y[0]));
	
	if(d > r[0]+r[1]){
		cout<< "0"<< endl;
		return true;
	}
	if(d < (max(r[0],r[1]) - min(r[0],r[1])) ){
		if(r[0] < r[1]){
			cout<< "-2"<< endl;
		}
		if(r[0] > r[1]){
			cout<< "2"<< endl;
		}
		return true;
	}
	cout<< "1"<<endl;
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	int n;
	cin>> n;
	for(int i=0;i<n;i++){
		solve();
	}

	return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r = pow(pow(xb - xa, (float)2.0) + pow(yb - ya, (float)2.0), (float)1.0/2);
		if (r > ra + rb) {
			cout << 0 << endl;
		}
		else if (r <ra-rb){
			cout << 2 << endl;
		}
		else if (r < rb - ra) {
			cout << -2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}