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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

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

inline double distance(std::array<double, 2> pa,std::array<double, 2> pb){
	return sqrt( (pa[0] - pb[0])*(pa[0] - pb[0]) + (pa[1] - pb[1])*(pa[1] - pb[1]) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;
	std::vector<int> number;
	for(int i = 0; i < dataSetNum; ++i){
		std::array<double, 2> pa[i];
		std::array<double, 2> pb[i];
		double ra[i],rb[i];
		std::cin >> pa[i][0] >> pa[i][1] >> ra[i] >> pb[i][0] >> pb[i][1] >> rb[i];

		double dis = distance(pa[i],pb[i]);
		//if A and B do not overlap
		if(dis > ra[i] + rb[i]) number[i] = 0;
		//if B is in A
		else if(ra[i] > rb[i] && dis + rb[i] <= ra[i]) number[i] = 2;
		//if A is in B,
		else if(rb[i] > ra[i] && dis + ra[i] <= rb[i]) number[i] = -2;
		//if circumference of A and B intersect
		else number[i] = 1;
	}
	for(int i = 0; i < dataSetNum; ++i) std::cout << number[i] << std::endl;
	return 0;
	}

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

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

int main(){
	int n;
	double 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>
#include <vector>

struct Vector2D {
	double x;
	double y;
	double abs() const {
		return std::sqrt(x * x + y * y);
	}
	Vector2D& operator-=(const Vector2D& rhs) {
		x -= rhs.x;
		y -= rhs.y;
		return *this;
	}
};

Vector2D operator-(const Vector2D& lhs, const Vector2D& rhs)
{
	return Vector2D(lhs) -= rhs;
}

int main()
{
	int data_count = 0;
	std::cin >> data_count;
	for (int i = 0; i < data_count; ++i) {
		Vector2D a, b;
		double ra, rb;
		if (std::cin >> a.x >> a.y >> ra >> b.x >> b.y >> rb) {
			double rab = (b - a).abs();
			int result;
			if (ra > rab + rb) {
				result = 2;
			} else if (rb > rab + ra) {
				result = -2;
			} else if (ra + rb < rab) {
				result = 0;
			} else {
				result = 1;
			}
			std::cout << result << std::endl;
		}
	}

	return 0;
}

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

typedef pair<double,double>vec;

double norm(vec v1,vec v2){
    return sqrt((v1.first-v2.first)*(v1.first-v2.first)+(v1.second-v2.second)*(v1.second-v2.second));
}
int main()
{
    int n;
    cin>>n;
    while(n--){
        double x1,y1,r1,x2,y2,r2;
        cin>>x1>>y1>>r1>>x2>>y2>>r2;
        vec v1=make_pair(x1,y1);
        vec v2=make_pair(x2,y2);
        double dis=norm(v1,v2);
        if(dis>r1+r2)
            cout<<0<<endl;
        else if(dis>abs(r1-r2)&&dis<r1+r2){
            cout<<1<<endl;
        }
        else if(r1>r2){
            cout<<2<<endl;
        }
        else cout<<-2<<endl;
    }
    return 0;
}

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

int main(){
	int num ;
	cin >> num;
	for(int j = 1;j<= num; j++){
	double x[2],y[2],r[2],r2[2];
	for(int i =0;i<=1;i++){
		cin >> x[i];
		cin >> y[i];
		cin >> r[i];
	}
	double d;
	d = sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
	if(r[0]+r[1]<d) cout << 0 << endl;
	else if(d >2* r[0]&& d > 2*r[1]) cout << 1 << endl;
	else if(r[0]<r[1]) cout << -2 << endl;
	else cout << 2 << endl;
	}
	return 0;
}

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 <= ra + rb) cout << "1" << endl;
		else cout << "0" << endl;
	}

	return 0;
}

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

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

double dist(double xa,double ya,double xb,double yb){
	return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
}
int main(){
	double xa,ya,ra,xb,yb,rb;
	int n;
	cin>>n;
	while(n--){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double d = dist(xa,ya,xb,yb);
		if(d+rb < ra)cout<<2;
		else if(d+ra < rb)cout<<-2;
		else if(d < ra+rb)cout<<1;
		else cout<<0;
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cctype>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	int n;
	cin>>n;
	while(n--){
		double xa,ya,ra,xb,yb,rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double dist=hypot(xa-xb,ya-yb);
		
		int res;
		if(dist>ra+rb)
			res=0;
		else if(ra>dist+rb)
			res=2;
		else if(rb>dist+ra)
			res=-2;
		else
			res=1;
		
		cout<<res<<endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
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;

    int ans = 0;

    if( ra*ra >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + rb*rb ) ans = 2;
    else if( rb*rb >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + ra*ra ) ans = -2;
    else if( (ra*ra)+(rb*rb) >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) ans = 1;


    cout << ans << endl;
  }

  return 0;
}