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 <vector>
#include <iostream>
#include <complex>
#include <cstdio>

#define pb push_back
#define fs first
#define sc second
#define sz size()
using namespace std;

typedef double D;
typedef complex<D> P;
typedef pair<P, P> L;
typedef pair<P, D> C;
typedef vector<P> Poly;
const D EPS=1e-12;


namespace std{
  bool operator<(const P &a, const P &b){
    return real(a)==real(b)?imag(a)<imag(b):real(a)<real(b);
  }
}

P unit(P p){ return p / abs(p);}

D dot(P x, P y){return real(conj(x)*y);}

D cross(P x, P y){return imag(conj(x)*y);}

P rotate(P v, double s){
  return P(real(v)*cos(s) - imag(v) * sin(s), real(v)*sin(s) + imag(v) * cos(s));
}

D arg(P a, P b, P c){ return acos(dot(b-a, c-a)/(abs(b-a)*abs(c-a)));}
D arg(D a, D b, D c){return acos((b*b+c*c-a*a)/(2*b*c));}

int ccw(P a, P b, P c){
  b -= a; c -= a;
  if(cross(b, c) > EPS) return 1;
  if(cross(b, c) < -EPS) return -1;
  if(dot(b, c) < -EPS) return 2;
  if(abs(b) < abs(c)) return -2;
  return 0;
}

bool para(L a, L b){return abs(cross(a.fs - a.sc, b.fs-b.sc))<EPS;}

int cpr(C a, C b){
  double d = abs(a.fs-b.fs);
  if(a.sc + b.sc + EPS < d) return 0;
  if(b.sc + d + EPS < a.sc) return 2;
  if(a.sc + d + EPS < b.sc) return -2;
  return 1;
}

vector<P> cp_cir_to_cir(C a, C b){
  vector<P> v;
  D s = arg(b.sc, abs(b.fs -a.fs), a.sc);
  P x = a.sc * unit(b.fs - a.fs);
  v.pb(a.fs + rotate(x, s));
  v.pb(a.fs + rotate(x, -s));
  return v;
}


D area(Poly p){
  if(p.sz<3) return 0;
  D res = cross(p[p.sz-1],p[0]);
  for(int i=1;i<p.sz;i++) res += cross(p[i-1], p[i]);
  return res/2;
}

int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    D xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    printf("%d\n", cpr(C(P(xa, ya), ra), C(P(xb, yb), rb)));
  }
  return 0;
}

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


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

  return 0;
}

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

inline float distance_pow2(float xa, float ya, float xb, float yb){
	return (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb);
}

inline int judge(std::vector<float> ve){
	float center_dis = distance_pow2(ve[0], ve[1], ve[3], ve[4]);
	float r_dis = (ve[2] + ve[5])*(ve[2] + ve[5]);
	if(center_dis > r_dis){
		return 0;	
	}else{
		if(center_dis >= ve[2]*ve[2] && center_dis >= ve[5]*ve[5]){
			return 1;
		}else{
			return ve[2] > ve[5] ? 2 : -2;
		}
	}
}

int main(void){
	int num;
	std::vector<float> 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 <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	double xa, ya, xb, yb, ra, rb;
	vector<int> Decision;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if ((ra+rb)*(ra + rb) <= ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)))Decision.push_back(0);
		else if ((ra - rb)*(ra - rb) < ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) && ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) < (ra + rb)*(ra + rb))Decision.push_back(1);
		else if ((ra - rb)*(ra - rb) > ((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb))) {
			if (ra > rb)Decision.push_back(2);
			else Decision.push_back(-2);
		}
	}
	for (int i = 0; i < Decision.size(); i++)cout << Decision[i] << endl;
	return 0;
}

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

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

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
    L:;
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("-2");goto L;}
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("2");goto L;}
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        swap(a.first,a.second); swap(b.first,b.second);
        if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        puts("0");
        
    }
}

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

int main(){

	std::array<double, 3> a; //0:xa 1:ya 2:ra
	std::array<double, 3> b;

	int N;

	std::cin >> N;

	for(int i = 0; i < N; ++i){
		
		for(int j = 0; j < 3; ++j)
			std::cin >> a[j];

		for(int j = 0; j < 3; ++j)
			std::cin >> b[j];

		double ab = hypot( (a[0] - b[0]) + (a[1] - b[1]) );

		if( ab > (a[2] + b[2]) )
			std::cout << 0 << std::endl;
		
		else if ( a[2] > ab + b[2] )
			std::cout << 2 << std::endl;

		else if ( b[2] > ab + a[2] )
			std::cout << -2 << std::endl;

		else
			std::cout << 1 << std::endl;

	}
	
	return 0;

}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double pitagoras(double x1,double y1,double x2,double y2){
  return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}

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