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

const long double EPS = 1e-8;

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 = dist(xa, ya, xb, yb);
//    cout << d << endl;
    
    if (sq(ra - rb) > d + EPS and ra > rb + EPS) {
      cout << 2 << endl;
    } else if (sq(ra - rb) > d + EPS and rb > ra + EPS) {
      cout << -2 << endl;
    } else if (d > sq(ra + rb) + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

C++: #include<bits/stdc++.h>
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 a) { return Point(a * x, a * y); }
  Point operator / (double a) { return Point(x / a, y / a); }
  
  double abs() { return sqrt(norm()); }
  double norm() { return x * x + y * y; }
  
  bool operator < (const Point &p) const {
    return x != p.x ? x < p.x : y < p.y;
  }
  
  bool operator == (const Point &p) const {
    return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
  }
};

typedef Point Vector; // ベクトルを表す構造体

struct Segment { // 線分を表す構造体
  Point p1,p2;
};

typedef Segment Line; // 直線を表す構造体

class Circle { // 円を表すクラス
public:
  Point c;
  double r;
  Circle(Point c = Point(), double r = 0.0): c(c),r(r) {}
};
typedef vector < Point > Polygon; // 多角形

double dot(Vector a, Vector b) {
  return a.x * b.x + a.y * b.y;
}
 
double cross(Vector a, Vector b) {
  return a.x * b.y - a.y * b.x;
}

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;
 
int ccw(Point p0, Point p1, Point p2) {
  Vector a = p1 - p0;
  Vector b = p2 - p0;
 
  if( cross(a,b) > EPS ) return COUNTER_CLOCKWISE;
  if( cross(a,b) < -EPS ) return CLOCKWISE;
  if( dot(a,b) < -EPS ) return ONLINE_BACK;
  if( a.norm() < b.norm() ) return ONLINE_FRONT;
 
  return ON_SEGMENT;
}

bool intersect(Point p1,Point p2,Point p3,Point p4){
  return ( ccw(p1,p2,p3) * ccw(p1,p2,p4) <= 0 && 
	   ccw(p3,p4,p1) * ccw(p3,p4,p2) <= 0);
}

bool intersect(Segment s1,Segment s2){
  return intersect(s1.p1,s2.p1,s1.p2,s2.p2);
}

int contains(Polygon g,Point p){
  int n = g.size();
  bool x = false;
  for(int i=0;i<n;i++){
    Point a = g[i] - p, b = g[(i+1)%n] - p;
    if(abs(cross(a,b)) < EPS && dot(a,b) < EPS) return 1;
    if(a.y > b.y) swap(a,b);
    if(a.y < EPS && EPS < b.y && cross(a,b) > EPS) x = !x;
  }
  return (x ? 2 : 0);
}

/*
double distance( Point p1,Point p2){
  return sqrt( (p1.y - p2.y) * (p1.y - p2.y) + (p1.x - p2.x) * (p1.x - p2.x));
}
*/

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

int main(){
  Point p1,p2,p3,p4;
  double ra,rb;
  int n;
  cin >> n;
  while(n--){
    cin >> p1.x >> p1.y >> ra >> p2.x >> p2.y >> rb;
    double d = distance(p1.y,p1.x,p2.y,p2.x);
    int ret = 1;
    if(d > ra + rb) ret = 0;
    if(d + ra < rb) ret = 1;
    if(d + rb < ra) ret = 2;
    cout << ret << endl;
  }
}

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

using namespace std;

int main() {
  
  int N; cin >> N;
  double xa, ya, xb, yb, ra, rb;
  while(N--) {
    cin >> xa >> ya >> ra;
    cin >> xb >> yb >> rb;
    double dist2 = pow(xb-xa, 2) + pow(yb-ya, 2);
    
    if(dist2 < pow(ra-rb, 2) && rb < ra) {
      cout << 2 << endl;
    }
    else if(dist2 < pow(ra-rb, 2) && ra < rb) {
      cout << -2 << endl;
    }
    else if(pow(ra+rb, 2) < dist2) {
      cout << 0 << endl;
    }
    else {
      cout << 1 << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>

#define PI 3.1415926535897932384626433
#define ToRadian(r) ((r)/180.0*PI)
#define ToDegree(r) ((r)*180.0/PI)
#define pow2(x) ((x) * (x))

using namespace std;

int main ( void )
{
	int n;
	
	while ( cin >> n )
	{
		while (n--)
		{
			double xa, ya, ra, xb, yb, rb;
			cin >> xa >> ya >> ra;
			cin >> xb >> yb >> rb;
			
			double dist_sq = pow2(xa - xb) + pow2(ya - yb);
			double dist_r_sq = pow2(ra + rb);
			
			if ( dist_sq >= dist_r_sq )
			{
				cout << 0 << endl;
			}
			else
			{
				double dist = sqrt(dist_sq);
				double dist_a = dist + ra;
				double dist_b = dist + rb;
				int ans = 1;
				if (dist_b <= ra)
					ans = 2;
				if (dist_a <= rb)
					ans = -2;
				cout << ans << endl;
			}
		}
	}
	return 0;
}

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

using namespace std;

int main() {
	int n, ans;
	float x1, y1, r1, x2, y2, r2, dis;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		dis = hypot(x2 - x1, y2 - y1);
		ans = 0;

		if (dis < r2 - r1) { ans = 2; }
		else if (dis < r1 - r2) { ans =  -2; }
		else if (r1 + r2 >= dis) { ans = 1; }

		cout << ans << endl;
	}
	return 0;
}

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

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

int main(void){

    CIRCLE a,b;
    int n;
    double sum,diff1,diff2,len;

    cin >> n;

    while(n > 0){

        cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;

            sum = a.r + b.r;
            diff1 = a.r - b.r;
            diff2 = b.r - a.r;
            len = sqrt(pow(a.x - b.x,2.0) + pow(a.y - b.y,2.0));

            if(diff1 > len){
                cout << "2" << endl;
            }else if(diff2 > len){
                cout << "-2" << endl;
            }else if(fabs(diff1) <= len && len <= a.r + b.r){
                cout << "1" << endl;
            }else{
                cout << "0" << endl;
            }

        n--;
    }

    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int loop;
    double xa, ya, ra, xb, yb, rb;
    
    cin >> loop;
    for(int i = 0; i < loop; i++){
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        //cout << xa << ya << ra << xb << yb << rb;
        double d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
        
        if(d < ra - rb){
            cout << 2 << endl;
        } else if(d < rb - ra){
            cout << -2 << endl;
        } else if(d == ra + rb || d == abs(ra - rb)){
            cout << 1 << endl;
        } else {
            cout << 0 << endl;
        }
    }
}

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

using namespace std;

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