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 <iostream>
#include <cmath>
using namespace std;

int main(){
	int n;cin >> n;
	double x1, y1, r1, x2, y2, r2;
	while(n--){
		int a = 1;
		cin >>x1>>y1>>r1>>x2>>y2>>r2;
		double d = pow(y2-y1, 2)+pow(x2-x1, 2);
		d = sqrt(d);
		if(d > (r1 + r2))a = 0;
		else if(r1 > d + r2)a = 2;
		else if(r2 > d + r1)a = -2;
		cout << a << endl;
	}
	return 0; 
}

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

int main(int argc, char *argv[]) {
	int dataN;
	//scanf("%d", &dataN);
	cin>>dataN;
	for (int i = 0; i < dataN; i++) {
		double ax, ay, ra, bx, by, rb;
		//scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		cin>>ax>>ay>>ra>>bx>>by>>rb;
		double d = (ax-bx)*(ax-bx) + (ay-by)*(ay-by);

		d = sqrt(d);

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

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

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-5;

#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)
#define LE(x,y) (x < y + EPF)
#define GE(x,y) (x + EPF > y)

double dot(P a, P b) {
  return (conj(a)*b).X;
}
double cross(P a, P b) {
  return (conj(a)*b).Y;
}
int isparallel(P a, P b, P c, P d) {//ab,cd
  return EQ(cross(a-b, c-d),0);
}
double distPP(P a, P b) {
  return sqrt(dot(a-b,a-b));
}
int relationCC(P c1, double r1, P c2, double r2) {//0..not overlap, 1..intersect, 2..2isin1, -2..1isin2
  double d = distPP(c1,c2);
  if(GE(d , r1+r2)) return 0;
  else if(GE(d , r1-r2) && GE(d , r2-r1)) return 1;
  else if(GE(r1 , r2)) return 2;
  else return -2;
  return -1;
}
P intersection(P a, P b, P c, P d) {//ac , bd
  double d1 = cross(d-b,b-a);
  double d2 = cross(d-b,c-a);
  if(EQ(d1,0) & EQ(d2,0)) return a;
  if(EQ(d2,0)) return a;
  return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
  P b(-a.Y, a.X);
  return b;
}
P polar(double r, double theta) {
  P a(r*cos(theta),r*sin(theta));
  return a;
}


int main() {
  int n;
  scanf("%d",&n);
  REP(i,n) {
    double x,y,r1,r2;
    scanf("%lf %lf %lf", &x, &y, &r1);
    P a(x,y);
    scanf("%lf %lf %lf", &x, &y, &r2);
    P b(x,y);
    printf("%d\n", relationCC(a,r1,b,r2));
  }
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
 
int main()
{
	int n;
	cin >> n;
	while( n-- > 0){
		double xa,ya,ra,xb,yb,rb;
		cin >> xa >> xb >> ra >> xb >> yb >> rb;
		double ab = sqrt(pow(xb-xa, 2.0) + pow(yb-ya, 2.0));
		if(ab > ra+rb){ 
			cout << 0 << endl;
		}else if(ab >= fabs(ra-rb) ){
			cout << 1 << endl;
		}else if(ra > rb){
			cout << 2 << endl;
		}else  {
			cout << -2 << endl;
		}
	}		
	return 0;
}

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

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main() {
  int n; cin >> n;
  while(n--) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));

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

C++: #include<iostream>
using namespace std;
int main(){
	int c;
	double ax,ay,ar,bx,by,br;
	cin>>c;
	for(int i=0;i<c;i++){
		cin>>ax>>ay>>ar>>bx>>by>>br;
		if((ax+ar>bx+br&&ax-ar<bx-br) && (ay+ar>by+br&&ay-ar<by-br))
			cout<<'2';
		else if((bx+br>ax+ar&&bx-br<ax-ar) && (by+br>ay+ar&&by-br<ay-ar))
			cout<<"-2";
		else if((ax+ar>bx-br&&bx+br>ax-ar)&&(bx+br>ax-ar&&ax+ar>bx-br))
			cout<<"1";
		else cout<<"0";
	cout <<endl;	
	}				
}

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;
}