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++: //#define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion


int main()
{
    int n;
    cin >> n;
    rep(i, n) {
        double x_a, y_a, r_a, x_b, y_b, r_b;
        cin >> x_a >>y_a >> r_a >> x_b >> y_b >> r_b;
        double dist = hypot(x_a - x_b, y_a - y_b);
        if (dist + r_b < r_a) P(2);
        else if (dist + r_a < r_b) P(-2);
        else if (dist <= r_a + r_b) P(1);
        else P(0);
    }
    return 0;
}

C++: #include <iostream>
#include <stack>
#include <stdio.h>
#include <cmath>
#include <utility>
using namespace std;
int main()
{
    int n;
	cin>>n;
	while(n--){
		int ans=0;
		double ax,ay,ar,bx,by,br,d;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		d=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(d<abs(ar-br)){//a)b||a(b
			ans=2;
			if(ar<br)ans*=-1;
		}else if(d<ar+br){
			ans=1;
		}
		cout<<ans<<endl;
	}
    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(a.r - b.r > distance)
            cout << 2 << endl;
        else if(abs(a.r + b.r) < distance)
            cout << 0 << 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;

        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>

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 = (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(u-r1 <= r2 || u-r2 <= r1){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

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

int main(){
  int n;
  double xa,ya,ra,xb,yb,rb,d;
  std::cin >> n;

  for(int i=0;i<n;i++){
    std::cin >> xa >> ya >> ra
             >> xb >> yb >> rb;
    d = std::sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    if(ra+rb < d){
      std::cout << 0 << std::endl;
      break;
    }
    if(ra+d < rb){
      std::cout << -2 << std::endl;
      break;
    }
    if(rb+d < ra){
      std::cout << 2 << std::endl;
    }else{
      std::cout << 1 << std::endl;
    }
  }
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n; scanf("%d", &n);
	rep(i, n) {
		double x1, y1, r1, x2, y2, r2;
		scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &r1, &x2, &y2, &r2);
		double d = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
		if (d > r1 + r2)puts("0");
		else if (d <= r1 - r2)puts("2");
		else if (d <= r2 - r1)puts("-2");
		else puts("1");
	}
}

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

int judgeIntersection(double distance, double ra, double rb){
    if(distance > (ra + rb))
        return 0;
    else if((distance + ra) < rb)
        return -2;
    else if((distance + rb) < ra)
        return 2;
    else
        return 1;
}

int main(void){
    double xa, ya, ra, xb, yb, rb; 
    int N;
    std::cin >> N;
    while(std::cin >> xa >> ya >> ra >> xb >> yb >> rb){
        double distance = std::sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
        std::cout << judgeIntersection(distance, ra, rb) << std::endl;
    }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb;
  int n;
  cin >> n;
  while(n--){
    cin >>  xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(pow(xa - xb,2) + pow(ya - yb,2));
    if(d + rb < ra){
      cout << 2 << endl;
    }else if(d + ra < rb ){
      cout << -2 << endl;
    }else if(ra + rb <= d){
      cout << 0 << endl;
    }else cout << 1 << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define PI 3.14
int main(void)
{
  double xa,ya,ra,xb,yb,rb;
  double areaa,areab;
  double len;
  int n;
  
  cin >> n;
  for(int i = n ; i > 0 ; i--){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    
    areaa = ra * ra * PI;
    areab = rb * rb * PI;

    len = abs(xa - xb) * abs(xa - xb) + abs(ya - yb) * abs(ya - yb);
    len = sqrt(len);

    if(len > ra + rb) cout << 0 << endl;
    else if(ra + rb > len && len > ra - rb) cout << 1 << endl;
    else if(len < ra - rb && areaa >= areab) cout << 2 << endl;
    else if(len < ra - rb && areab >= areaa) cout << -2 << endl;
  }
  return 0;
}