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

int main(){
  // (x, y) r
  double a[3],b[3];
  int n;

  cin >> n;
  while(n > 0){
    // input
    for(int i = 0; i < 3; i++){
      cin >> a[i];
    }
    for(int i = 0; i < 3; i++){
      cin >> b[i];
    }

    // distance
    double distance;
    distance = sqrt(pow(a[0] - b[0], 2) + pow(a[1] - b[1], 2));

    // judgment
    if(distance > a[2] + b[2]){
      cout << "0" << endl;
    }
    else if(distance < a[2] - b[2]){
      cout << "2" << endl;
    }
    else if(distance < b[2] - a[2]){
      cout << "-2" << endl;
    }
    else{
      cout << "1" << endl;
    }
    
    n--;
  }

  return 0;
}

C++: /*
中心が (xa, ya) で半径 ra の円 A と、中心が (xb, yb) で半径 rb の円 B が与えられたとき、
 B が A の中にあるとき 2、
 A が B の中にあるとき -2、
 A の円周と B の円周が交わっている場合 1、
 A と B が重なっていないとき 0
を出力して終了するプログラムを作成して下さい。なお A と B は同じものではないとします。
xa ya ra xb yb rb
*/
#include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

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((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
    int res;
    if (rb + d < ra) {
      res = 2;
    } else if (ra + d < rb) {
      res = -2;
    } else if (d <= ra + rb) {
      res = 1;
    } else {
      res = 0;
    }
    cout << res << endl;
  }
}

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 (ra > rb && ra >= d + rb) {
		  cout<<2<<endl;
		} else if (rb > ra && rb >= d + ra) {
		  cout<<-2<<endl;
		} else if (ra + rb < d) {
		  cout<<0<<endl;
		} else {
		  cout<<1<<endl;
		}
	}
	return 0;
}

C++: #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair
typedef long long LL;
#define EPS (1e-6)
double zero(double d){
  return d < EPS ? 0.0 : d;
}

typedef pair<int,int> P;


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(7);
  int INF = 1000000;

  int N;
  cin >> N;
  REP(t,N){
    double x1,y1,r1,x2,y2,r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

    double dis = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
    if( dis > r1+r2 )
      cout << 0 << endl;
    else if( r2 > r1+dis )
      cout << -2 << endl;
    else if( r1 > r2+dis )
      cout << 2 << endl;
    else
      cout << 1 << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
#define int long long
signed main(){
	int n;
	scanf("%lld",&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 d = sqrt(pow(xa-xb,2)+pow(ya-yb,2));
		if( rb+d < ra ) cout << "2" << endl;
		else if( ra+d < rb ) cout << "-2" << endl;
		else if( d > ra+rb) cout << "0" << endl;
		else cout << "1" << endl;
	}
	return 0;
}

C++: // clear time: 00:20
#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++: #include<iostream>
#include<cmath>
using namespace std;

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

int main()
{
	int n;
	Point p1,p2;
	
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> p1.x >> p1.y >> p1.r>> p2.x >> p2.y >> p2.r;
		double sumR = p1.r + p2.r;
		double l = sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
		
		if (p1.r > p2.r) {
			double subR = p1.r - p2.r;
			if (l < subR) {
				cout << "2" << endl;
			}
			else if (l <= sumR && l >= subR) {
				cout << "1" << endl;
			}
			else if (l > sumR) {
				cout << "0" << endl;
			}
		}
		else {
			double subR = p2.r - p1.r;
			if (l < subR) {
				cout << "-2" << endl;
			}
			else if (l <= sumR &&  l >= subR) {
				cout << "1" << endl;
			}
			else if (l > sumR) {
				cout << "0" << endl;
			}
		}
	}
	return 0;
}

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;

		data.push_back( isCircleToCircle(a,b) );
	}

	for(int i=0;i<n;i++){
		cout<<data.at(i)<<endl;
	}

	return 0;
}

C++: #include <iostream>
#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 = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
    if (d+ra < rb) cout << -2 << endl;
    else if (d+rb < ra) cout << 2 << endl;
    else if (d <= ra+rb) cout << 1 << endl;
    else cout << 0 << endl;
  }
  return 0;
}

C++: #include <iostream>
#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 dr = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if(ra >= rb+dr)
			cout << 2 << endl;
		else if(rb >= ra+dr)
			cout << -2 << endl;
		else if(dr <= ra + rb)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

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

int solve(long double d,long double ra,long double rb){
  if(ra+rb<d){
    return 0;
  }else if(ra+rb==d){
    return 1;
  }else if(ra+d<rb){
    return -2;
  }else if(rb+d<ra){
    return 2;
  }else{
    assert(0);
  }
  return -100;
}



int main(){
  long double xa,xb,ya,yb,ra,rb;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    cout<<solve(sqrt(pow(ya-yb,2)+pow(xa-xb,2)),ra,rb)<<endl;
  }
}