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 <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;

double dist(double x1, double x2, double y1, double y2) {
	double dx = xa - xb;
	double dy = ya - yb;
	return sqrt(dx*dx + dy*dy);
}

int main() {
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		double dist_ab = dist(xa, ya, xb, yb);

		if (dist_ab < ra) {
			if (dist_ab + rb < ra) {
				cout << "2" << endl;
			} else {
				cout << "1" << endl;
			}
		} else if (dist_ab < rb) {
			if (dist_ab + ra < rb) {
				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<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;

int main(){
  int n,cnt=0;
  double xa,ya,ra,xb,yb,rb;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    if(xa+1*ra>=xb+1*rb) cnt++;
    if(ya+1*ra>=yb+1*rb) cnt++;
    if(xa+-1*ra<=xb+-1*rb) cnt++;
    if(ya+-1*ra<=yb+-1*rb) cnt++;
 


    if(xa+1*ra<xb-1*rb || ya+1*ra<yb-1*rb) cout<<0<<endl;
    else if(xa-1*ra>xb+1*rb || ya-1*ra>yb+1*rb) cout<<0<<endl;
    else if(cnt==4) cout<<2<<endl;
    else if(cnt==0) cout<<-2<<endl;
    else cout<<1<<endl;
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

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 ab = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (ab + rb - ra <= EPS) cout << "2" << endl;
		else if (ab + ra - rb <= EPS) cout << "-2" << endl;
		else if (ab - ra - rb >= EPS) cout << "0" << endl;
		else cout << "1" << endl;
	}
	return 0;
}

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

int n, m;
double a, b, p, c, d, q, t;

int main()
{
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> a >> b >> p >> c >> d >> q;

		t = sqrt((a - c) * (a - c) + (b - d) * (b - d));

		if (p + q < t)
			m = 0;
		else if (p - q > t)
			m = 2;
		else if (q - p > t)
			m = -2;
		else
			m = 1;

		cout << m << endl;
	}
}

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

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

int main(){
	int n,c;
	float 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]){
			cout << 0 << endl;
		}
		else{
			if(dd + r[0] < r[1] || dd + r[1] < r[0]){
				cout << 2 << endl;
			}
			else
			{
				cout << 1 << endl;
			}
		}
	}
	return 0;
}

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

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

C++: #include <iostream>
#include <math.h>
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 = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
		if(l>ra+rb){
			cout<<"0"<<endl;
		}else if(l<rb){
			cout<<"2"<<endl;
		}else if(l<ra){
			cout<<"-2"<<endl;
		}else{
			cout<<"1"<<endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(r1+r2 <= u){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		long double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		long double d = hypot(xa - xb, ya - yb);
		if (d < 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++: // AOJ 0023
#include<iostream>
#include<cmath>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const long double EPS = 1e-7;

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

long double abs(long double x) {
  return (x > 0 ? x : -x);
}
/*
bool eq(long double x, long double y) {
  return abs(x - y) < EPS;
}*/

long double dist(long double xa, long double ya, long double xb, long double yb) {
  return sq(xa - xb) + sq(ya - yb);
}

int main() {
  int n;
  cin >> n;
  REP(i, n) {
    long double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    long double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
    
    if (ra - rb > d + EPS) {
      cout << 2 << endl;
    } else if (rb - ra > d + EPS) {
      cout << -2 << endl;
    } else if (d > ra + rb + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

C++: #include <iostream>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      double d = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
      if(d  > (ra+rb)*(ra+rb))
	ans = 0;
      else if (d <=  (ra-rb)*(ra-rb))
	ans = 2;
      else if (d  <= (rb-ra)*(rb-ra))
	ans =-2;
      else
	ans =-1;

      cout<<ans<<endl;

    }

}

C++: //接する場合が未定義なのだが…
#include<iostream>
using namespace std;

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