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++: 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>

#include <algorithm>
#include <complex>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
#endif

#define ITER(c)         __typeof__((c).begin())
#define FOREACH(it, c)  for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define RITER(c)        __typeof__((c).rbegin())
#define RFOREACH(it, c) for (RITER(c) it=(c).rbegin(); it != (c).rend(); ++it)
#define REP(i, n)       REPEAT(i, 0, n)
#define REPEAT(i, k, n) for (int i = (k); i < (n); ++i)
#define REVREP(i, n)    for (int i = ((n)-1); i >= 0; --i)
#define FIND(c, n)      std::find((c).begin(), (c).end(), (n));
#define BSEARCH(c, n)   std::binary_search((c).begin(), (c).end(), (n))
#define LLPOW(p1,p2)    ((ll)pow((double)(p1), (int)p2))
#define ESIZEOF(A)      (sizeof(A)/sizeof((A)[0]))
#define MIN(p1,p2)      (((p1)<(p2))?(p1):(p2))
#define MAX(p1,p2)      (((p1)>(p2))?(p1):(p2))
#define CIN_NO_SYNC     do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0)
#define GETSTR(p)       fgets((p), sizeof(p), stdin)
#define CHOMP(p)        do{ char *_q = (p) + strlen(p)-1; if(*_q == '\n') *_q = 0; } while(0)

#define X real()
#define Y imag()
typedef double D;
typedef complex<double>P;
#define EPS (1e-9)

int main(){
    int n;
    cin >> n;
    REP(i,n){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        P pa(xa,ya), pb(xb,yb);
        D distance = sqrt(norm(pa-pb));

        //cout << "distance = " << distance << endl;
        if(ra-rb > distance){
            cout << 2 << endl;
            continue;
        }
        if(rb-ra > distance){
            cout << -2 << endl;
            continue;
        }
        if(distance > ra+rb){
            cout << 0 << endl;
            continue;
        } else {
            cout << 1 << endl;
            continue;
        }

    }
    return 0;
}

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

struct circle
{
    double x;
    double y;
    double r;
};

double getDistance(circle a, circle b)
{
    return sqrt(pow(a.x - b.x ,2)
            +pow(a.y - b.y ,2));
}

int main()
{
    int n;
    circle a, b;
    double distance;
    cin >> n;
    for(int c = 0; c < n; c++)
    {
        cin >> a.x >> a.y >> a.r
            >> b.x >> b.y >> b.r;
        distance = getDistance(a, b);
        if(abs(a.r + b.r) > distance)
            cout << 0 << endl;
        else if(a.r - b.r > distance)
            cout << 2 << endl;
        else if(abs(a.r - b.r) < distance && a.r + b.r > distance)
            cout << 1 << endl;
        else if(b.r - a.r > distance)
            cout << -2 << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int n,i;
  double xa,ya,ra,xb,yb,rb;
  double dist;

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );

    if(dist>ra+rb)
      cout<<"0"<<endl;
    else if(rb<dist || ra<dist || ra==rb)
      cout<<"1"<<endl;
    else if(rb<ra)
      cout<<"2"<<endl;
    else if(ra<rb)
      cout<<"-2"<<endl;
  }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(void)
{
	double x[2],y[2],r[2];
	int n;
	cin >> n;
	while(n--){
		for(int i=0; i<2; i++){
			cin >> x[i] >> y[i] >> r[i];
		}
		double d = sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2));
		if(r[0]+r[1]<d) cout << "0" << endl;
		else if(r[0]>r[1]){
			if(r[0]-r[1]<=d&&d<=r[0]+r[1]) cout << "1" << endl;
			if(d < r[0] -r[1]) cout << "2" << endl;
		}else{
			if(r[1]-r[0]<=d&&d<=r[0]+r[1]) cout << "1" << endl;
			if(d < r[1] -r[0]) cout << "-2" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<math.h>

using namespace std;

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

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

int main(){
	
	int n,z;
	double x1,y1,r1;
	double x2,y2,r2;
	
	cin>>n;
	
	for(int i=0;i<n;i++){
		cin >> x1 >> y1 >> r1 ;
		cin >> x2 >> y2 >> r2 ;
		
		double m = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ) ;
		
		if( r1 >= m+r2 ) z=2;
		else if( r2 > m+r1 ) z=-2;
		else{
			if( r1+r2 >= m ) z=1;
			else z=0;
		}
		
		cout << z << endl;
	}
return 0;
}

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

inline double distance(double xa, double ya, double xb, double yb){
	return std::sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
}

int judge(std::vector<double> ve){
	double center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(ve[2] >= center_dis + ve[5]){
		return 2;
	}else if(ve[5] >= center_dis + ve[2]){
		return -2;
	}else{
		return 1;
	}
}

int main(void){
	int num;
	std::vector<double> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

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

int collision_detection(double x1, double y1, double x2, double y2, double r1, double r2){
	double d = ((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
	double sr = ((r1+r2)*(r1+r2));
	double dr = ((r1-r2)*(r1-r2));
	if( d > sr ){
		return 0;
	}else if( d < sr && dr < d){
		return 1;
	}else if(dr > d){
		return (r1>r2)? 2 : -2;
	}else{
		return 1;
	}
}

int main(){
	int n, ans;
	double xa, ya, ra, xb, yb, rb;

	cin >> n;
	for(int i=0 ; i<n ; i++){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		ans = collision_detection( xa, ya, xb, yb, ra, rb);
		cout << ans << endl;
	}
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    double xa, ya, ra, xb, yb, rb;
    int n;
    cin >> n;
    rep(i, n)
    {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = sqrt(pow((xa - xb), 2) + pow(ya - yb, 2));
        if (d > ra + rb)
            OP(0);
        else
        {
            if (d + rb < ra)
                OP(2);
            else if (d + ra < rb)
                OP(-2);
            else
                OP(1);
        }
    }

    return 0;
}