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<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-d2>EPS) return 0;
  if(d1+b.r-a.r<EPS) return 2;
  if(d1+a.r-b.r<EPS) return -2;
  return 1;
}
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 <cmath>

using namespace std;

void solve()
{
	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));
		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;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;
double ab(double a){
	if(a>=0)return a;
	return -a;
}
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 a=sqrt((yb-ya)*(yb-ya)+(xb-xa)*(xb-xa));
	if(a>ra+rb){
		printf("0\n");
	}
	else if(ab(ra-rb)<a){
		printf("1\n");
	}
	else if(ra>rb)printf("2\n");
	else printf("-2\n");
	}
    return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  ll n,i;
  ld xa,ya,ra,xb,yb,rb;
  ld dist;

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );//2????????????????????¢

    if(dist>ra+rb)//AB?????¢??????????????¨???
      cout<<"0"<<endl;
    else{
      if((rb<dist && ra<dist )|| ra==rb)//?????????????????¢??????????????????????????§??????
	cout<<"1"<<endl;
      else if(rb<ra && dist<ra)
	cout<<"2"<<endl;
      else if(ra<rb && dist<rb)
	cout<<"-2"<<endl;
    }
  }
}

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-d2>EPS) return 0;
  if(d1+b.r-a.r<EPS) return 2;
  if(d1+a.r-b.r<EPS) return 2;
  return 1;
}
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 <cstdio>
#include <complex>

using namespace std;
typedef long long ll;

typedef double R;
typedef complex<R> P;

R cross(const P &a, const P &b) { return imag(conj(a)*b); }
R dot(const P &a, const P &b) { return real(conj(a)*b); }

struct C {
    P p;
    R r;
    C () {};
    C (P p, R r) : p(p), r(r) {};
};

C c[2];
int solve() {
    for (int i = 0; i < 2; i++) {
        R x, y, r;
        cin >> x >> y >> r;
        c[i] = C(P(x, y), r);
    }
    R dist = abs(c[0].p - c[1].p);
    if (c[0].r > c[1].r + dist) return 2;
    if (c[1].r > c[0].r + dist) return -2;
    if (c[0].r + c[1].r >= dist) return 1;
    return 0;
}


int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cout << solve() << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#define EPS 0.000000001
using namespace std;

double X[2][60],Y[2][60],R[2][60];
int res[60];
int main(){
	int N;
	cin>>N;
	for(int i=1;i<=N;i++){
		for(int j=0;j<2;j++){
			cin>>X[j][i]>>Y[j][i]>>R[j][i];
		}
	}

	double re;
	for(int i=1;i<=N;i++){
		re=pow(X[0][i]-X[1][i],2)+pow(Y[0][i]-Y[1][i],2);
		if(re>pow(R[0][i]+R[1][i],2)){
			res[i]=0;
		}
		else if(re>=pow(R[0][i]-R[1][i],2)){
			res[i]=1;
		}
		else if(R[0][i]>R[1][i]){
			res[i]=2;
		}
		else res[i]=-2;
	}
	for(int i=1;i<=N;i++){
		cout<<res[i]<<endl;
	}
	return 0;
}

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

int main(void){
	int i,j,n;
	double d,c[2][3];

	cin>>n;
	while(n--){
		for(i=0;i<2;i++) for(j=0;j<3;j++) cin>>c[i][j];

		d = sqrt( pow( c[1][0] - c[0][0], 2 ) + pow( c[1][1] - c[0][1], 2 ) );

		if(c[0][2] <= c[1][2] && d + c[0][2] < c[1][2]){
			cout<<"-2\n";
		}
		else if(c[0][2] >= c[1][2] && d + c[1][2] < c[0][2]){
			cout<<"2\n";
		}
		else if(d > c[0][2] + c[1][2]){
			cout<<"0\n";
		}
		else{
			cout<<"1\n";
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (((ll)1<<31)-1)
#define eps LDBL_EPSILON
#define moder (1000000007)
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
#define ggr getchar();getchar();return 0;
using namespace std;
int n;
long double a,b,c,d,e,f;
signed main(){
	cin>>n;
	rep(i,n){
		cin>>a>>b>>c>>d>>e>>f;
		if(hypot(a-d,b-e)>c+f)cout<<0<<endl;
		else if(hypot(a-d,b-e)<c-f)cout<<2<<endl;
		else if(hypot(a-d,b-e)<f-c)cout<<-2<<endl;
		else cout<<1<<endl;
	}
	return 0;
}

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

int main() {
	double N,xa,ya,ra,xb,yb,rb,i,j;
	
	for(cin>>N,i=N;i;--i){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		
		if( ra >= rb && (ra-rb) * (ra-rb) > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) )	
			cout << 2 << endl;
			
		else if( rb >= ra && (ra-rb) * (ra-rb) > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
			cout << -2 << endl;
		
		else if( (ra+rb) * (ra+rb) > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) )
			cout << 1 << endl;
			
		else cout << 0 << endl;
	}
}