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<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
#define equals(a,b) (fabs((a) - (b)) < EPS)
class Point{
public:
  double x,y;
  Point(double x = 0, double y = 0):x(x), y(y) {}
  Point operator + (Point p){
    return Point(x+p.x,y+p.y);
  }
  Point operator - (Point p){
    return Point(x-p.x,y-p.y);
  }
  Point operator * (double k){
    return Point(x*k,y*k);
  }
  Point operator / (double k){
    return Point(x/k,y/k);
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
typedef Point Vector;
double norm(Vector a){
  return a.x*a.x+a.y*a.y;
}
double abs(Vector a){
  return sqrt(norm(a));
}
class Circle{
public:
  Point c;
  double r;
  Circle(Point c = Point(),double r = 0.0):c(c),r(r){}
};
int check(Circle a,Circle b){
  double d1 = abs(b.c-a.c) , d2 = (a.r+b.r);
  
  if(d1+b.r-a.r<0) return 2;
  if(d1+a.r-b.r<0) return -2;
  if(d1-d2<0) return 1;
  return 0;
}
int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    Point a,b;
    double r1,r2;
    cin >> a.x >> a.y >> r1 >> b.x >> b.y >> r2;
    Circle c1(a,r1),c2(b,r2);
    cout << check(c1,c2) << endl;
  }
  return 0;
}

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

struct circle
{
    double x;
    double y;
    double r;
};

double getDistance(circle a, circle b)
{
    return sqrt(pow(a.x - b.x ,2)
            +pow(a.y - b.y ,2));
}

int main()
{
    int n;
    circle a, b;
    double distance;
    cin >> n;
    for(int c = 0; c < n; c++)
    {
        cin >> a.x >> a.y >> a.r
            >> b.x >> b.y >> b.r;
        distance = getDistance(a, b);
        if(abs(a.r + b.r) < distance)
            cout << 0 << endl;
        else {
            if(a.r - b.r > distance)
                cout << 2 << endl;
            else if(b.r - a.r > distance)
                cout << -2 << endl;
            else cout << 1 << endl;
        }
    }
    return EXIT_SUCCESS;
}

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

using db = double;
const db eps = 1e-9;
int sgn(db a, db b = 0) {
	a -= b;
	return (a > eps) - (a < -eps);
}

struct poi {
	db x, y;
	void r() { cin >> x >> y; }
	poi operator -(poi p) {
		return {x - p.x, y - p.y};
	}
	db len() {
		return sqrt(x * x + y * y);
	}
};

int main() {
	ios :: sync_with_stdio(false);
	int t; cin >> t;
	while(t --) {
		poi a, b; db ra, rb;
		a.r(); cin >> ra;
		b.r(); cin >> rb;
		db d = (b - a).len();
		if(sgn(d, ra + rb) == 0 ||
			sgn(d, abs(ra - rb)) == 0)
			cout << "1\n";
		else if(sgn(ra + d, rb) < 0)
			cout << "-2\n";
		else if(sgn(rb + d, ra) < 0)
			cout << "2\n";
		else
			cout << "0\n";
	}
	return 0;
}

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

using namespace std;

int main(void) {
	while(1) {
		int ds;
		cin >> ds;
		if( cin.eof() )		break;
		
		for(int i = 0; i < ds; i++) {
			double d, r1[3], r2[3];
			for(int j = 0; j < 3; j++)
				cin >> r1[j];
			for(int j = 0; j < 3; j++)
				cin >> r2[j];
			
			d = (r2[0] - r1[0]) * (r2[0] - r1[0]) + (r2[1] - r1[1]) * (r2[1] - r1[1]);
			
			if( d < abs(r1[2] - r2[2]) ) {
				cout << "2" << endl;
			}else if( d < abs(r2[2] - r1[2]) ) {
				cout << "-2" << endl;
			}else if( (abs(r1[2] - r2[2]) < d && d < r1[2] + r2[2]) || d == r1[2] + r2[2] ) {
				cout << "1" << endl;
			}else {
				cout << "0" << endl;
			}
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
#define EPS 1e-9
int n;
double xa,ya,ra,xb,yb,rb;

int main(){
	int i;
	scanf("%d",&n);
	
	for( i = 0;i < n;i++ ){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		//BがA中にあるか(境界ふくまない)
		if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra-rb)*(ra-rb) && rb < ra )
			puts("2");
		//AがB中にあるか(境界ふくまない)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra-rb)*(ra-rb) && ra < rb )
			puts("-2");
		//AとBが交わっているか(境界ふくまない)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra+rb)*(ra+rb) )
			puts("1");
		else
			puts("0");
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

int main(void){
	double x[2],y[2],r[2];
	int n;
	cin >> n;
	rep(i,n){
		rep(j,2) cin >> x[j] >> y[j] >> r[j];
		double D=norm(x[1]-x[0])+norm(y[1]-y[0]);
		double RG=norm(r[1]+r[0]);
		double RL=norm(r[1]-r[0]);
		if(RG<D)
			cout << 0 << endl;
		else if(RL<=D && D<=RG)
			cout << 1 << endl;
		else{
			if(r[0]<r[1])
				cout << -2 << endl;
			else
				cout << 2 << endl;
		}
	}
}

C++: #include<iostream>
#include<complex>
using namespace std;
typedef complex<double> P;

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

int main(){
	P x,y;
	double r1,r2,dis;
	int n;
	cin>>n;
	while(n--){
		cin>>x.real()>>x.imag()>>r1>>y.real()>>y.imag()>>r2;
		dis=abs(x-y);
		if(dis>r1+r2){
			cout<<"0"<<endl;
		}else if(dis<=r1){
			cout<<"2"<<endl;
		}else if(dis<=r2){
			cout<<"-2"<<endl;
		}else{
			cout<<"1"<<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 ve[2] > ve[5] ? 2 : -2;
		}else{
			return 1;
		}
	}
}

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++: // AOJ 0023
#include<iostream>
#include<cmath>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const long double EPS = 1e-6;

long double sq(long double x) {
  return x * x;
}

long double abs(long double x) {
  return (x > 0 ? x : -x);
}
/*
bool eq(long double x, long double y) {
  return abs(x - y) < EPS;
}*/

long double dist(long double xa, long double ya, long double xb, long double yb) {
  return sq(xa - xb) + sq(ya - yb);
}

int main() {
  int n;
  cin >> n;
  REP(i, n) {
    long double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    long double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
    
    if (ra - rb > d + EPS) {
      cout << 2 << endl;
    } else if (rb - ra > d + EPS) {
      cout << -2 << endl;
    } else if (d > ra + rb + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

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