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>

class Point
{
public:
	double m_X;
	double m_Y;
	Point(double x, double y)
		: m_X(x)
		, m_Y(y)
	{}
};

class LineSegment
{
private:
	Point m_Start;
	Point m_End;
public:
	LineSegment(Point start, Point end)
		: m_Start(start)
		, m_End(end)
	{}
	double Distance()
	{
		return(std::sqrt(std::pow(m_End.m_X - m_Start.m_X, 2.0) + std::pow(m_End.m_Y - m_Start.m_Y, 2.0)));
	}
	double CalcSlope()
	{
		if (m_End.m_Y == m_Start.m_Y)
		{
			return 0.0;
		}

		if (m_End.m_X == m_Start.m_X)
		{
			return 9999999999.0;
		}

		return((m_End.m_Y - m_Start.m_Y) / (m_End.m_X - m_Start.m_X));
	}
};

int main()
{
	int n = 0;
	std::cin >> n;

	while (n--)
	{
		double x1, y1, r1, x2, y2, r2;
		std::cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

		Point p1{ x1, y1 };
		Point p2{ x2, y2 };
		LineSegment line{ p1, p2 };
		double dist_center = line.Distance();

		if ((r1 + r2) < dist_center)
		{
			std::cout << 0 << std::endl;
			continue;
		}

		if ((r1 + r2) >= dist_center)
		{
			if (dist_center + r1 < r2)
			{
				std::cout << -2 << std::endl;
				continue;
			}
			if (dist_center + r2 < r1)
			{
				std::cout << 2 << std::endl;
				continue;
			}
			std::cout << 1 << std::endl;
			continue;
		}
	}

	return 0;
}

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

#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef complex<double> vec;

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

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

int main()
{
	int n, t;
	double x1, y1, r1, x2, y2, r2;
	double d;

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);

		d = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);

		if (d < (r2-r1)*(r2-r1)){
			if (r2 < r1) t = 2;
			else if (r2 > r1) t = -2;
		}else if (d >= (r1 + r2)*(r1 + r2)) t = 0;
		else if (d <= (r1 + r2)*(r1 + r2)) t = 1;

		printf("%d\n", t);
	}

	return 0;
}

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

using namespace std;

typedef complex<double> P;

int main(void){
  int n; cin >> n;
  while(n--){
    double ra, rb;
    P a,b;
    cin  >> a.real() >> a.imag() >> ra >> b.real() >> b.imag() >> rb;
    double d = abs(a-b);
    int ans;
    if(0){}
    else if(d + rb < ra) ans = 2;
    else if(d + ra < rb) ans = -2;
    else if(d > ra + rb) ans = 0;
    else ans = 1;
    cout << ans << endl;
  }
  return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N=in();
	REP(i,N){
		double x[2],y[2],r[2];
		cin>>x[0]>>y[0]>>r[0]>>x[1]>>y[1]>>r[1];
		double dist = hypot(x[1]-x[0],y[1]-y[0]);

		if(dist>r[0]+r[1]){
			out(0);
		}
		else if(r[0]<r[1] && dist<r[1]-r[0]){
			out(-2);
		}
		else if(r[1]<r[0] && dist<r[0]-r[1]){
			out(2);
		}
		else out(1);
	}
	
	return 0;
}

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

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

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

using namespace std;

double dis(long double x1,long double y1,long double x2,long double y2);

int main(){
	long double x1,y1,r1;
	long double x2,y2,r2;
	long double ans;
	double r[2];
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x1>>y1>>r1;
		cin>>x2>>y2>>r2;
		
		ans=dis(x1,y1,x2,y2);
		
		if(ans>r1+r2){
			cout<<"0"<<endl;
		}else if(ans<=r1+r2){
				if(r2>ans+r1){
					cout<<"-2"<<endl;
					continue;
				}else if(r1>ans+r2){
					cout<<"2"<<endl;
					continue;
				}
			
			cout<<"-1"<<endl;
		}
	
	}
}

double dis(long double x1,long double y1,long double x2,long double y2){
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


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

int main(){
	cin >> n;
	REP(i, n){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (xa == xb&&ya == yb){
			if (ra > rb){
				cout << 2 << endl;
			}
			else{
				cout << -2 << endl;
			}
			continue;
		}
		if (sqrt(pow(xa - xb, 2) + (ya - yb, 2)) > ra + rb){
			cout << 0 << endl;
		}
		else if (sqrt(pow(xa - xb, 2) + (ya - yb, 2)) == ra + rb){
			cout << 1 << endl;
		}
		else{
			if (sqrt(pow(xa - xb, 2) + (ya - yb, 2)) == abs(ra - rb)){
				if (ra > rb){
					cout << 2 << endl;
				}
				else{
					cout << -2 << endl;
				}
			}
		}
	}
}

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

int main(void){
    int n;
    double xa,ya,ra,xb,yb,rb;
    double dx,dy,dr;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        scanf("%lf %lf %lf", &xa, &ya, &ra);
        scanf("%lf %lf %lf", &xb, &yb, &rb);
        dx = xa - xb;
        dy = ya - yb;
        dr = sqrt(dx*dx + dy*dy);
        
        if (dr > ra + rb){
            printf("0\n");
        } else if (dr + ra < rb){
            printf("-2\n");
        } else if (dr + rb < ra){
            printf("2\n");
        } else {
            printf("1\n");
        }
    }
    
    return 0;
}