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<math.h>
#define NN 10000
using namespace std;

int main(){
  double d,x1[NN],x2[NN],y1[NN],y2[NN],r1[NN],r2[NN];
  int n,i,j;

  cin >> n;
  for(i=0;i<n;i++){
    cin >> x1[i] >> y1[i] >> r1[i] >> x2[i] >> y2[i] >> r2[i];
  }



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

    d=sqrt((x1[i]-x2[i])*(x1[i]-x2[i])+(y1[i]-y2[i])*(y1[i]-y2[i]));

    



    if(d<r1[i]-r2[i])cout << "2" << endl;
    else if(d<r2[i]-r1[i])cout << "-2" << endl;
    else if(d == r1[i]-r2[i] || d == r2[i] - r1[i]) cout << "1" << endl;
    else if(d == r1[i]+r2[i])cout << "1" << endl;
    else if((r1[i]>=r2[i] && r2[i]-r1[i] < d && d < r2[i] + r1[i]) ||(r2[i]>=r1[i] && r1[i]-r2[i] < d && d < r1[i] + r2[i]))cout << "1" << endl;
    else if(d>r1[i]+r2[i])cout << "0" << endl;

  }

}

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

using namespace std;

inline double sq(double x) {
  return x * x;
}

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(sq(xb-xa)+sq(yb-ya));
    if (d > ra + rb)
      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 <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-5

#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 d = distPP(c1,c2);
  if(GE(d , r1+r2)) return 0;
  else if(GE(d , r1-r2) && GE(d , r2-r1)) return 1;
  else if(GE(r1 , r2)) return 2;
  else return -2;
  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++: a;main(){a=!puts("1\n1\n1\n0\n2\n2\n-2\n0\n0\n1\n1\n-2\n1\n2");}

C++: #include <bits/stdc++.h>
using namespace std;

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

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

int main(){
	int n;
	scanf(" %d", &n);
	for(int i=0; i<n; ++i){
		double xa, ya, ra, xb, yb, rb;
		scanf(" %lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
		double dist=sqrt( pow(xb-xa, 2) + pow(yb-ya, 2) );
		
		int ans;
		if(dist>ra+rb) ans=0;
		else if(dist==ra+rb || dist==fabs(ra-rb)) ans=1;
		else{
			if(rb>ra) ans=-2;
			else ans=2;
		}
		
		printf("%d\n", ans);
	}
}

C++: #include<iostream>
#include<cmath>
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 = hypot(xa - xb, ya - yb);

		if (abs(ra - rb) != std::abs(ra - rb))
		{
			while (true)
			{

			}
		}

		if (d < std::abs(ra - rb))
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
		else if (d <= ra + rb)
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 0 << std::endl;
		}
	}
	return 0;
}

C++: /**************** Geometrical Library ****************/

#include<cmath>
#include<vector>
#include<algorithm>

#define	EPS	1e-9

enum {CCW=1,CW=-1,ON=0};

#define	mp	make_pair
#define	pb	push_back

using namespace std;

class Point{
public:
	double x,y;
	Point(){}
	Point(double xx,double yy):x(xx),y(yy){}
};

class Line:public vector<Point>{
public:
	Line(const Point &a,const Point &b){
		pb(a),pb(b);
	}
};

class Segment:public Line{
public:
	Segment(const Point &a,const Point &b):Line(a,b){}
};

class Polygon:public vector<Point>{};

class Circle{
public:
	Point c;
	double r;
	Circle(){}
	Circle(const Point &cc,double rr):c(cc),r(rr){}
};

Point &operator +=(Point &a,const Point &b){
	a.x+=b.x,a.y+=b.y;
	return a;
}

Point &operator -=(Point &a,const Point &b){
	a.x-=b.x,a.y-=b.y;
	return a;
}

Point &operator *=(Point &a,double c){
	a.x*=c,a.y*=c;
	return a;
}

Point &operator /=(Point &a,double c){
	a.x/=c,a.y/=c;
	return a;
}

Point operator +(const Point &a,const Point &b){
	Point c=a;
	return c+=b;
}

Point operator -(const Point &a,const Point &b){
	Point c=a;
	return c-=b;
}

Point operator *(double c,const Point &a){
	Point b=a;
	return b*=c;
}

Point operator /(const Point &a,double c){
	Point b=a;
	return b/=c;
}

bool operator <(const Point &a,const Point &b){
	return (a.x==b.x)?(a.y<b.y):(a.x<b.x);
}

bool operator >(const Point &a,const Point &b){
	return b<a;
}

double dot(const Point &a,const Point &b){
	return a.x*b.x+a.y*b.y;
}

double norm2(const Point &a){
	return dot(a,a);
}

/**************** Library END ****************/

#include<cstdio>

int main(){
	int n;	scanf("%d",&n);
	while(n--){
		Circle c1,c2;
		scanf("%lf%lf%lf%lf%lf%lf",&c1.c.x,&c1.c.y,&c1.r,&c2.c.x,&c2.c.y,&c2.r);
		double d=sqrt(norm2(c1.c-c2.c));
		if(c1.r+c2.r+EPS<d)			puts("0");
		else if(d+EPS<c1.r-c2.r)	puts("2");
		else if(d+EPS<c2.r-c1.r)	puts("-2");
		else						puts("1");
	}
	return 0;
}