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 <bits/stdc++.h>
using namespace std;

double eps = 1e-10;

class Point {
public:
	double x, y;
	
	Point(double x = 0, double y = 0) : x(x), y(y) {}
	
	Point operator + (const Point& p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (const Point& p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (const double& a) {
		return Point(x * a, y * a);
	}
	Point operator / (const double& a) {
		return Point(x / a, y / a);
	}
	
	bool operator < (const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator == (const Point& p) const {
		return fabs(x - p.x) < eps && fabs(y - p.y) < eps;
	}
	
	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	
};

class Circle {
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) : c(c), r(r) {}
};

int main() {
	int n;
	cin >> n;
	double x1, y1, r1, x2, y2, r2;
	for(int i = 0; i < n; ++i){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		Circle c1 = Circle(Point(x1, y1), r1);
		Circle c2 = Circle(Point(x2, y2), r2);
		double maxr = max(c1.r, c2.r);
		
		if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) < pow(maxr, 2.0)){
			if(c1.r > c2.r)
				cout << "2" << endl;
			else
				cout << "-2" << endl;
		}
		else if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) <= pow(c1.r + c2.r, 2.0)){
			cout << "1" << endl;
		}
		else if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) > pow(c1.r + c2.r, 2.0)){
			cout << "0" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar))return puts("-2")*0;
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar))return puts("2")*0;
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<=ar+br||abs(a.first-b.first)==min(ar,br))return puts("1")*0;
        else puts("0");
        
    }
}

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

using namespace std;

int main() {
	int n, ans;
	float x1, y1, r1, x2, y2, r2, dis, diff;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		dis = hypot(x2 - x1, y2 - y1);
		ans = 0;

		if (dis < r1 - r2) { ans = 2; }
		else if (dis< r2 - r1) { ans =  -2; }
		else if (r1 + r2 >= dis) { ans = 1; }

		cout << ans << endl;
	}
	return 0;
}

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

double eps = 1e-10;

class Point {
public:
	double x, y;
	
	Point(double x = 0, double y = 0) : x(x), y(y) {}
	
	Point operator + (const Point& p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (const Point& p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (const double& a) {
		return Point(x * a, y * a);
	}
	Point operator / (const double& a) {
		return Point(x / a, y / a);
	}
	
	bool operator < (const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator == (const Point& p) const {
		return fabs(x - p.x) < eps && fabs(y - p.y) < eps;
	}
	
	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	
};

class Circle {
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) : c(c), r(r) {}
};

int main() {
	int n;
	cin >> n;
	double x1, y1, r1, x2, y2, r2;
	for(int i = 0; i < n; ++i){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		Circle c1 = Circle(Point(x1, y1), r1);
		Circle c2 = Circle(Point(x2, y2), r2);
		double minr = min(c1.r, c2.r);
		double maxr = max(c1.r, c2.r);
		double dr = maxr - minr;
		
		if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) < dr){
			if(c1.r > c2.r)
				cout << "2" << endl;
			else
				cout << "-2" << endl;
		}
		else if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) <= pow(c1.r + c2.r, 2.0)){
			cout << "1" << endl;
		}
		else{
			cout << "0" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
typedef long double LD;

int main() {
	int n;
	cin >> n;
	for (int x = 0;x < n;x++) {
		LD a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		LD od = ((d - a)*(d - a)) + ((e - b)*(e - b));
		LD rw = (c + f)*(c + f);

		if (rw < od)cout << 0 << endl;
		else if (rw == od)cout << 1 << endl;
		else {
			if (c < f)cout << -2 << endl;
			else cout << 2 << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    double xa, ya, ra, xb, yb, rb, d;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    complex<double> c1(xa, ya), c2(xb, yb);
    d = abs(c1 - c2);
    cout << ((d > ra + rb) ? 0 : (d >= abs(ra - rb)) ? 1 : (ra > rb) ? 2 : -2) << endl;
  }
}

C++: #include <iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	double xa,ya,ra,xb,yb,rb;
	for(int i=0;i<n;i++){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double l = (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya);
		if(ra>rb && l<(ra-rb)*(ra-rb)){
			cout<<"2"<<endl;
		}else if(ra<rb && l<(rb-ra)*(rb-ra)){
			cout<<"-2"<<endl;
		}else if(l<(ra+rb)*(ra+rb)){
			cout<<"1"<<endl;
		}else{
			cout<<"0"<<endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(void) {
	int ds;
	cin >> ds;
	
	for(int i = 0; i < ds; i++) {
		double d, r1[3], r2[3];
		for(int j = 0; j < 3; j++)
			cin >> r1[j];
		for(int j = 0; j < 3; j++)
			cin >> r2[j];
		
		d = (r2[0] - r1[0]) * (r2[0] - r1[0]) + (r2[1] - r1[1]) * (r2[1] - r1[1]);
		
		if( d < abs(r1[2] - r2[2]) ) {
			cout << "2" << endl;
		}else if( d < abs(r2[2] - r1[2]) ) {
			cout << "-2" << endl;
		}else if( (abs(r1[2] - r2[2]) < d && d < r1[2] + r2[2]) || d == r1[2] + r2[2] ) {
			cout << "1" << endl;
		}else {
			cout << "0" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int c;
  double ax,ay,ar,bx,by,br;
  cin>>c;
  for(int i=0;i<c;i++){
    cin>>ax>>ay>>ar>>bx>>by>>br;
    if((ax+ar>bx+br&&ax-ar<bx-br) && (ay+ar>by+br&&ay-ar<by-br))
      cout<<"2"<<endl;
    else if((bx+br>ax+ar&&bx-br<ax-ar) && (by+br>ay+ar&&by-br<ay-ar))
      cout<<"-2"<<endl;
    else if((ax-bx)*(ax-bx)+(ay-by)*(ay-by)<(ar+br)*(ar+br))
      cout<<"1"<<endl;
    else cout<<"0"<<endl;
  }				
}