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 _USE_MATH_DEFINES
 
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

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 d = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
		if(d>ra*ra+rb*rb){
			cout << 0 << endl;
		}else if(d+rb*rb<ra*ra){
			cout << 2 << endl;
		}else if(d+ra*ra<rb*rb){
			cout << -2 << endl;
		}else{
			cout << 1 << endl;
		}
		*/
		double d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if(d>ra+rb){
			cout << 0 << endl;
		}else if(d+rb<ra){
			cout << 2 << endl;
		}else if(d+ra<rb){
			cout << -2 << endl;
		}else{
			cout << 1 << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)

static const double PI=6*asin(0.5);
typedef complex<double> P;
typedef long long ll;

double xa,ya,ra,xb,yb,rb;
int n;

double dist(P a,P b){
	return sqrt(real(a-b)*real(a-b)+imag(a-b)*imag(a-b));
}

int main(){
	cin>>n;
	rep(i,n){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		P a(xa,ya), b(xb,yb);
		double r=dist(a,b);
		double rr=ra-rb;
		if(rr<0) rr=-rr;
		if(ra+rb<r) cout<<0<<endl;
		else if(rr<=r&&r<=ra+rb) cout<<1<<endl;
		else if(ra<rb) cout<<-2<<endl;
		else cout<<2<<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 <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int main(void)
{
    ios::sync_with_stdio(false);
    int n;
    cin >> n;

    for(int i=0; i<n; i++) {
        double ra,rb,xa,ya,xb,yb;
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        double d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));

        if(d > ra + rb) {
            cout << 0 << endl;
        } else if(d < ra - rb) {
            cout << 2 << endl;
        } else if(d < rb - ra) {
            cout << -2 << endl;
        } else {
            cout << 1 << endl;
        }
    }

    return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  double x[2], y[2], r[2];
  rep(i, n){
    rep(j, 2){
      cin >> x[j] >> y[j] >> r[j];
    }
    double dis = sqrt((x[1] - x[0]) * (x[1] - x[0]) + (y[1] - y[0]) * (y[1] - y[0]));
    if(dis > r[0] + r[1])cout << 0 << endl;
    else if(abs(r[0] - r[1]) < dis){
      cout << 1 << endl;
    }else{
      if(r[0] > r[1]){
        cout << 2 << endl;
      }else{
        cout << - 2 << endl;
      }
    }
  }
	return 0;
}