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

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-3;

#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)
#define LE(x,y) (x < y + EPF)
#define GE(x,y) (x + EPF > y)

double dot(P a, P b) {
  return (conj(a)*b).X;
}
double cross(P a, P b) {
  return (conj(a)*b).Y;
}
int isparallel(P a, P b, P c, P d) {//ab,cd
  return EQ(cross(a-b, c-d),0);
}
double distPP(P a, P b) {
  return sqrt(dot(a-b,a-b));
}
int relationCC(P c1, double r1, P c2, double r2) {//0..not overlap, 1..intersect, 2..2isin1, -2..1isin2
  double d2 = dot(c1-c2,c1-c2);
  double prr = (r1+r2)*(r1+r2);
  double mrr = (r1-r2)*(r1-r2);
  printf("%lf %lf\n", c2.X, prr);
  if(GE(d2 ,prr)) return 0;
  else if(GE(mrr, d2)) {
    if(r1 > r2) return 2;
    else return -2;
  }
  else return 1;
}
P intersection(P a, P b, P c, P d) {//ac , bd
  double d1 = cross(d-b,b-a);
  double d2 = cross(d-b,c-a);
  if(EQ(d1,0) & EQ(d2,0)) return a;
  if(EQ(d2,0)) return a;
  return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
  P b(-a.Y, a.X);
  return b;
}
P polar(double r, double theta) {
  P a(r*cos(theta),r*sin(theta));
  return a;
}


int main() {
  int n;
  scanf("%d",&n);
  REP(i,n) {
    double x,y,r1,r2;
    scanf("%lf %lf %lf", &x, &y, &r1);
    P a(x,y);
    scanf("%lf %lf %lf", &x, &y, &r2);
    P b(x,y);
    printf("%d\n", relationCC(a,r1,b,r2));
  }
  return 0;
}

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

using namespace std;

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

C++: #include <cstdio>
#include <cmath>
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);
		//printf("%f\n", d);
		if (d > ra+rb) puts("0");
		else if (d==0) {
			if (ra > rb) puts("2");
			else puts("-2");
		}
		else {
			// cross type
			if (d > ra && d > rb) puts("1");
			// inner type
			else if (d < ra && d > rb) puts("2");
			else if (d > ra && d < rb) puts("-2	");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb;
  int n;
  cin >> n;
  while(n--){
    cin >>  xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(pow(xa - xb,2) + pow(ya - yb,2));
    if(d  < ra - rb){
      cout << '2' << endl;
    }else if(d < rb - ra ){
      cout << '-2' << endl;
    }else if(ra + rb < d){
      cout << '0' << endl;
    }else cout << '1' << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
#define EPS (1e-10)
#define equals(a,b) (fabs((a) - (b)) < EPS)
class Point{
public:
  double x,y;
  Point(double x = 0, double y = 0):x(x), y(y) {}
  Point operator + (Point p){
    return Point(x+p.x,y+p.y);
  }
  Point operator - (Point p){
    return Point(x-p.x,y-p.y);
  }
  Point operator * (double k){
    return Point(x*k,y*k);
  }
  Point operator / (double k){
    return Point(x/k,y/k);
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
typedef Point Vector;
double norm(Vector a){
  return pow(a.x,2.0)+pow(a.y,2.0);
}
double abs(Vector a){
  return sqrt(norm(a));
}
int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    Point a,b;
    double r1,r2;
    cin >> a.x >> a.y >> r1 >> b.x >> b.y >> r2;
    double d1 = sqrt((b.x-a.x)*(b.x-a.x)+(b.y-a.y)*(b.y-a.y));
    int res;
    if(d1+r2-r1<0) res=2;
    else if(d1+r1-r2<0) res=-2;
    else if(d1<r1+r2) res= 1;
    else res= 0;
    cout << res << endl;
  }
  return 0;
}

C++: #include<cstdio>
#include<cmath>
double xa,ya,ra,xb,yb,rb;
double dist(){
    return sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
        if(dist()+rb<=ra) printf("2\n");
        else if(dist()+ra<=rb) printf("-2\n");
        else if(dist()<=ra+rb) printf("1\n");
        else printf("0\n");
    }
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,n-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);

#include <complex>
typedef complex<double> P;

struct L {
	P a, b;
	L(const P &a, const P &b) : a(a), b(b) { }
};

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

double dot(P a, P b) {
	return real(conj(a)*b);
}

double cross(P a, P b) {
	return imag(conj(a)*b);
}

bool LLcross(L l1, L l2) {
	return abs(cross(l1.b-l1.a, l2.b-l2.a)) > EPS || abs(cross(l1.b-l1.a, l2.b-l1.a)) < EPS;
}

double dist(P p1, P p2) {
	return sqrt((p2.real()-p1.real())*(p2.real()-p1.real()) + (p2.imag()-p1.imag())*(p2.imag()-p1.imag()));
}

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

	REP(i, n) {
		double x, y, r;
		cin >> x >> y >> r;
		C c1(P(x, y), r);

		cin >> x >> y >> r;
		C c2(P(x, y), r);

		double d = dist(c1.p, c2.p);
		int ans;
		if((d-c1.r*2) < EPS) {
			ans = 2;
		} else if((d-c2.r*2) < EPS) {
			ans = -2;
		} else if((d-c1.r-c2.r) < EPS) {
			ans = 1;
		} else {
			ans = 0;
		}

		cout << ans << endl;
	}

	return 0;
}

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


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

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