Go: package main

import (
        "fmt"
        "math"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                var ax, ay, ar, bx, by, br float64
                fmt.Scanf("%f %f %f %f %f %f", &ax, &ay, &ar, &bx, &by, &br)

                d := math.Sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay))
                if d <= ar + br {
                        if ar > br {
                                if ar > br + d {
                                        fmt.Println("2")
                                } else {
                                        fmt.Println("1")
                                }
                        } else {
                                if br > ar + d {
                                        fmt.Println("-2")
                                } else {
                                        fmt.Println("1")
                                }
                        }
                } else {
                        fmt.Println(0)
                }
        }
}

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

using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
#define int ll

#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=a;i--)
#define per(i,b) gnr(i,0,b)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define fs first
#define sc second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif
#define tmp template<class t>

tmp void chmax(t&a,t b){if(a<b)a=b;}
tmp void chmin(t&a,t b){if(a>b)a=b;}

tmp using vc=vector<t>;
tmp using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.fs<<","<<p.sc<<"}";
}

tmp ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

constexpr ll ten(int n){
	return n==0?1:ten(n-1)*10;
}

tmp void mkuni(vc<t>&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}

ll read(){ll i;cin>>i;return i;}

using ld=long double;
using cm=complex<ld>;
#define x real()
#define y imag()
const ld eps=1e-8;
int sgn(ld a){return a<-eps?-1:(a>eps?1:0);}
auto cmcmp=[](const cm&a,const cm&b){
	if(sgn(a.x-b.x))return a.x<b.x;
	else return sgn(a.y-b.y)<0;
};

struct ln{
	cm a,b;
	cm dir(){return b-a;}
};
ld dot(cm a,cm b){return a.x*b.x+a.y*b.y;}
ld crs(cm a,cm b){return a.x*b.y-a.y*b.x;}
int ccw(cm a,cm b){return sgn(crs(a,b));}
int ccw(cm a,cm b,cm c){return ccw(b-a,c-a);}
int ccw(ln a,cm b){return ccw(a.a,a.b,b);}

//(-2)[a,-1](0)[b,1](2)
int bet(cm a,cm b,cm c){
	cm d=b-a;
	ld e=dot(d,c-a);
	if(sgn(e)<=0)return sgn(e)-1;
	return sgn(e-norm(d))+1;
}

ld tri2(cm a,cm b,cm c){
	return crs(b-a,c-a);
}

ld area2(const vc<cm>&a){
	int n=a.size();
	ld b=0;
	rep(i,n)
		b+=crs(a[i],a[(i+1)%n]);
	return b;
}

struct cr{
	cm c;
	ld r;
};

//0-apart,1-coinside,2-a<b,3-a<=b,4-a>b,5-a>=b,6-a touch b,7-a cross b
int intcc(cr a,cr b){
	ld c=abs(a.c-b.c);
	if(sgn(c)==0&&sgn(a.r-b.r)==0)return 1;
	int d=sgn(c+a.r-b.r);
	if(d<=0)return d+3;
	int e=sgn(c+b.r-a.r);
	if(e<=0)return e+5;
	int f=sgn(a.r+b.r-c);
	if(f>=0)return f+6;
	return 0;
}

cm readcm(){
	ld a,b;
	cin>>a>>b;
	return cm(a,b);
}

ld readld(){
	ld a;
	cin>>a;
	return a;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(1);
	
	int n=read();
	rep(_,n){
		cr a{readcm(),readld()};
		cr b{readcm(),readld()};
		int c=intcc(a,b);
		if(c==0)
			cout<<0<<endl;
		else if(c==1)
			assert(false);
		else if(c==2)
			cout<<-2<<endl;
		else if(c==4)
			cout<<2<<endl;
		else
			cout<<1<<endl;
	}
}

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(center_dis < ve[2] - ve[5]){
		return 2;
	}else if(center_dis < ve[5] - 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>

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){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>  
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
	int N;
	scanf("%d", &N);
	rep(i, N) {
		double ax, ay, ar, bx ,by, br;
		scanf("%lf %lf %lf %lf %lf %lf", &ax, &ay, &ar, &bx, &by, &br);
		double AB = sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
		double ABdis = ar + br;
		if(AB > ABdis) printf("0\n");
		else if(AB + ar < br) printf("-2\n");
		else if(AB + br < ar) printf("2\n");
		else printf("1\n");
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define EPS 1e-9

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

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

int main()
{
//	cut here before submit 
//	freopen ("testcase.CI", "r", stdin );
	int n;
	scanf ("%d", &n );
	rep (i, n ){
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = calc_dis (xa, ya, xb, yb );
//		cerr << "d: " << d << endl;
		int res = -1;
		if (ra + rb + EPS < d ){	// A and B do not overlap
			res = 0;
		}else
		if (fabs (ra + rb - d ) < EPS || fabs (fabs(ra - rb ) - d ) < EPS || (ra + rb + EPS > d  && fabs (ra - rb ) < d ) ){ // if circumference of A and B intersect
			res = 1;
		}else
		if (ra > rb ){	// if B is in A, 
			res = 2;
		}else
		if (ra < rb ){	// if A is in B,
			res = -2;
		}else{
			res = 1;		// if A and B is same
		} // end if
		cout << res << endl;
	} // end rep
		
	return 0;
}

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

using namespace std;

struct Vector
{
	double x;
	double y;
};

istream& operator>>(istream& stream, Vector& p)
{
	return stream >> p.x >> p.y;
}

int main()
{
	int length;
	cin >> length;

	while(length-- > 0)
	{
		Vector a, b;
		double ra, rb;
		cin >> a >> ra >> b >> rb;
		double dist = sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y));

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

	return 0;
}