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 <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>

using namespace std;
int main(){
	int N;
	cin >> N;
	for(int i = 0;i < N;i++){
		double xa, ya, ra;
		double xb, yb, rb;
		double d, R;

		cin >> xa >> ya >> ra;
		cin >> xb >> yb >> rb;

		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		R = fabs(ra-rb);
		if(ra+rb < d){
			cout << "0" << endl;
		}
		else if(ra+rb == d || (R < d && d < ra+rb) || R == d){
			cout << "1" << endl;
		}
		else if(R > d && ra > rb){
			cout << "2" << endl;
		}
		else if(R > d && ra < rb){
			cout << "-2" << endl;
		}

	}

	
	return 0;
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

struct Circle
{
	double x, y;
	double r;
};

int hit(Circle c0, Circle c1)
{
	double x = (c1.x - c0.x);
	double y = (c1.y - c0.y);

	double d = sqrt(x * x + y * y);
	if (d <= c0.r + c1.r)
	{
		if (c0.r >= d || c1.y >= d)
		{
			return 2;
		}
		else
		{
			return -2;
		}
	}
	else
	{
		return 0;
	}
}

int main()
{
	int n;
	for (cin >> n; n--;)
	{
		Circle c0, c1;
		cin >> c0.x >> c0.y >> c0.r;
		cin >> c1.x >> c1.y >> c1.r;

		cout << hit(c0, c1) << endl;
	}
}

C++: /*AOJ 0023*/

#include<iostream>
#include<vector>

using namespace std;

class Circle_obj{
public:
	double x,y,r;
};

int isCircleToCircle(Circle_obj a,Circle_obj b){

	double tmpX = a.x - b.x;
	double tmpY = a.y - b.y;

	double R = tmpX*tmpX + tmpY*tmpY;

	if(a.r >= b.r){
		if( R <= a.r*a.r){
			return 2;
		}
	}
	else{
		if( R <= b.r*b.r){
			return -2;
		}
	}

	if( R <= a.r*a.r + b.r * b.r){
		return 1;
	}
	else{
		return 0;
	}
}

int main(){

	int n;

	cin>>n;

	Circle_obj a,b;

	vector<int> data;

	for(int i=0;i<n;i++){
		cin>>a.x;
		cin>>a.y;
		cin>>a.r;
		cin>>b.x;
		cin>>b.y;
		cin>>b.r;

		cout<<isCircleToCircle(a,b)<<endl;
	}
	/*
	for(int i=0;i<n;i++){
		cout<<data.at(i)<<endl;
	}
	*/

	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int N;
struct C{
	double x,y,r;
};
main()
{
	cin>>N;
	for(;N--;)
	{
		C a,b;
		cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
		double d=hypot(a.x-b.x,a.y-b.y);
		cout<<(d>a.r+b.r?0:d<a.r-b.r?2:d<b.r-a.r?-2:1)<<endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <complex>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)

typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = (1e-10);    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) {
  return (conj(a)*b).Y;
}

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;
    P a = P(xa, ya);
    P b = P(xb, yb);

    if (LE(ra+rb, abs(a-b))) {
      std::cout << 0 << std::endl;
      continue;
    }

    if (LE(abs(a-b)+ra, rb)) {
      std::cout << -2 << std::endl;
    }else if (LE(abs(a-b)+rb, ra)) {
      std::cout << 2 << std::endl;
    }else {
      std::cout << 1 << std::endl;
    }
  }

  
  return 0;
}

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

using namespace std;

int main()
{
	double xa, ya, ra, xb, yb, rb;
	int N;
	cin >> N;
	
	for (int i=0; i<N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		double D = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
		if ( D > ra + rb ) {
			cout << "0" << endl;
		}
		else if ( abs(ra - rb) <= D ) {
			cout << "1" << endl;
		}
		else {
			if (rb < ra) {
				cout << "2" << endl;
			}
			else {
				cout << "-2" << 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(a.r - b.r > distance)
            cout << 2 << endl;
        else if(abs(a.r + b.r) < distance)
            cout << 0 << endl;
        else if(abs(a.r - b.r) > distance && a.r + b.r > distance)
            cout << 1 << endl;
        else if(b.r - a.r > distance)
            cout << -2 << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n;
  double x1,x2,y1,y2,r1,r2;

  while(cin>>n){
    for(int i=0;i<n;i++){
      cin>>x1>>y1>>r1>>x2>>y2>>r2;
      if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<(r1+r2)*(r1+r2)){
	if(r1>r2){
	  cout<<"2"<<endl;
	}
	else{
	  cout<<"-2"<<endl;
	}
      }
      else if ((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)>(r1+r2)*(r1+r2)){
	cout<<"0"<<endl;
      }
      else{
	cout<<"1"<<endl;
      }
    }
  }
  return 0;
}

C++: #include <iostream> 
#include <string> 
#include <vector> 
#include <cmath> 
 
 
#define TIMES(i) while(i--) 
#define REP(i, n) for ( int i = 0; i < n; i++ ) 
 
 
 using namespace std;
 
 int main() { 
     int n; 
     cin >> n; 
 
     TIMES(n) { 
         // ??\??? 
         double ax, ay, ar, bx, by, br; 
         cin >> ax >> ay >> ar >> bx >> by >> br; 
 
         // ?????¢????±??????? 
         double dis_x = abs(ax-bx), 
           dis_y = abs(ay-by), 
             dist = sqrt(dis_x * dis_x + dis_y * dis_y); 
 
         // cout << dis_x << " " << dis_y << " " << dist << endl; 
 
         // ??¢???????????? 
         if ( dist > ar + br ) { 
             cout << 0; 
 
         // a???????????????????????? 
         } else if ( dist + ar < br ) { 
             cout << -2; 
 
         // b???????????????????????? 
         } else if ( dist + br < ar ) { 
             cout << 2; 
 
         // ????????£????????? 
         } else { 
             cout << 1; 
         } 
         cout << endl; 
     } 
 
 
     return 0; 
 }

C++: // AOJ 0023
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const double EPS = 1e-7;

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

double abs(double x) {
  return (x > 0 ? x : -x);
}

bool eq(double x, double y) {
  return abs(x - y) < EPS;
}

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

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

    double d = dist(xa, ya, xb, yb);
    
    if (d < sq(ra)) {
      cout << 2 << endl;
    } else if (d < sq(rb)) {
      cout << -2 << endl;
    } else if (eq(d, ra) or eq(d, rb)) {
      cout << 1 << endl;
    } else if (d < sq(ra + rb)) {
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
  }
}