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<vector>
#include<complex>
using namespace std;

typedef pair<double,double>vec;

double norm(vec v1,vec v2){
    return (v1.first-v2.first)*(v1.first-v2.first)+(v1.second-v2.second)*(v1.second-v2.second);
}
int main()
{
    int n;
    cin>>n;
    while(n--){
        double x1,y1,r1,x2,y2,r2;
        cin>>x1>>y1>>r1>>x2>>y2>>r2;
        vec v1=make_pair(x1,y1);
        vec v2=make_pair(x2,y2);
        double dis=norm(v1,v2);
        if(dis>(r1+r2)*(r1+r2))
            cout<<0<<endl;
        else if(dis>(r1-r2)*(r1-r2)&&dis<(r1+r2)*(r1+r2)){
            cout<<1<<endl;
        }
        else if((r1-r2)*(r1-r2) > dis){
            if((r1-r2)>0){
                cout<<2<<endl;
            }
            else if((r1-r2)<0)cout<<-2<<endl;
        }
        else cout<<1<<endl;
    }
    return 0;
}

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

int main(){
	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;
		double range = sqrt( (yb-ya)*(yb-ya)+(xb-xa)*(xb-xa) );
		int ret=1;
		if( rb > range+ra ){
			ret = -2;
		}else if( ra > range+rb ){
			ret = 2;
		}else if( range > ra+rb ){
			ret = 0;
		}
		cout << ret << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<complex>
#define EPS 1e-10
using namespace std;

typedef complex<double>P;

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		double ra,rb;
		P pa,pb;
		
		cin>>pa.real()>>pa.imag()>>ra;
		cin>>pb.real()>>pb.imag()>>rb;
		double d=abs(pa-pb);
		if(d+ra-rb<=EPS)cout<<-2<<endl;
		else if(d+rb-ra<=EPS)cout<<2<<endl;
		else if(d-ra-rb<=EPS)cout<<1<<endl;
		else cout<<0<<endl;
	}
}

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

int solve(double xa, double ya, double ra, double xb, double yb, double rb){
    double distance = sqrt(pow(xa - ya, 2) + pow(ya - yb, 2));
    if (distance > ra + rb) return 0;
    else if (distance < ra - rb) return 2;
    else if (distance < rb - ra) return -2;
    else return 1;
}

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;
	cout << solve(xa, ya, ra, xb, yb, rb);
    }
}

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

using namespace std;

double judge(double, double, double, double, double, double);

int main() {

	double xa, ya, ra, xb, yb, rb, N, ans;

	cin >> N;

	for(int i=0; i<N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		ans=judge(xa, ya, ra, xb, yb, rb);
		cout << ans << endl;
	}

	return 0;

}

double judge(double xa, double ya, double ra, double xb, double yb, double rb) {

	double d=sqrt(pow(xa-xb, 2)+pow(ya-yb, 2));

	if(ra+rb<d)
		return 0;
	else if(abs(ra-rb)>d)
		return ra>rb ? 2 : -2;
	else
		return 1;

}

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

using namespace std;

int main() {
    double xa, ya, ra, xb, yb, rb;
    int n;

    cin >> n;
    while(n--) {
        int ret = 1;
        double d;

        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        d = sqrt(pow(xb-xa, 2) + pow(yb-ya, 2));
        if (ra + rb < d) {
            ret = 0;
        }else if (ra - rb > d) {
            ret = 2;
        }else if (rb - ra > d) {
            ret = -2;
        }

        cout << ret << endl;
    }
    return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb, sr, dr;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya - yb);
		float d = abs(comp);
		sr = ra + rb;
		if(ra < rb){
			dr = rb - ra;
		}
		else{
			dr = ra - rb;
		}
		if(d > sr){
			cout << "0" << endl;
		}
		else if(d < sr && dr < d){
			cout << "1" << endl;
		}
		else if(d < dr){
			if(rb < ra){
				cout << "2" << endl;
			}
			else if(ra < rb){
				cout << "-2" << endl;
			}
		}
	return 0;
	}
}

C++: #include<iostream>
#include<math.h>

using namespace std;

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

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

using namespace std;

void judge(double, double, double, double, double, double);

int main() {

	double xa, ya, ra, xb, yb, rb, N;

	cin >> N;

	for(int i=0; i<N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		judge(xa, ya, ra, xb, yb, rb);
	}

	return 0;

}

void judge(double xa, double ya, double ra, double xb, double yb, double rb) {

	double d=sqrt(pow(xa-xb, 2)+pow(ya-yb, 2));

	if(ra+rb<d)
		cout << "0" << endl;
	else if(ra+rb>d&&d>abs(ra-rb)||ra+rb==d)
		cout << "1" << endl;
	else if(ra-rb>d)
		cout << "2" << endl;
	else if(rb-ra>d)
		cout << "-2" << endl;

}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  cin>>n;
  rep(i,n){
    double xa,ya,ra,xb,yb,rb;
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    double dist=hypot(abs(xa-xb),abs(ya-yb));
    if(dist>ra+rb)cout<<0<<endl;
    else if(dist+rb<ra)cout<<2<<endl;
    else if(dist+ra<rb)cout<<-2<<endl;
    else cout<<1<<endl;
  }
}

C++: #include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;

int main(void){
	double ax, ay, ar, bx, by ,br;
	double dist;
	double large, small;
	int n;
	int i;

	cin >> n;
	for(i=0;i<n;i++){
		cin >> ax >> ay >> ar >> bx >> by >> br;

		//calc distance between points
		dist = sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
		if(dist > ar + br){
			cout << 0 << endl;
		}else if(dist <= ar + br && dist >= fabs(ar - br) ){ //ツ静堋点ツづーツ篠敖づづつ「ツづゥ
			cout << 1 << endl;
		}else{
			if(max(ar, br) == ar){
				cout << 2 << endl;
			}else{
				cout << -2 << endl;
			}
		}
	}

	return 0;
}

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

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

C++: #include <iostream>
#define EPS (1e-10)
using namespace std;
int main(){
	int n, a;
	cin >> n;
	while(n--){
		double x[2], y[2], r[2], d2, t1, t2;
		for(int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i];
		d2 = (x[1]-x[0])*(x[1]-x[0]) - (y[1]-y[0])*(y[1]-y[0]);		//??????????£?????????¢
		t1 = (r[0]+r[1])*(r[0]+r[1]);
		t2 = (r[0]-r[1])*(r[0]-r[1]);

		if(d2 > t1 - EPS) a = 0;				// d > ra+rb: ???????????????
		else if(d2 >= t2 - EPS) a = 1;	// ra+rb >= d >= ra-rb: ?????????
		else  r[0] > r[1] ? a = 2 : a = -2;							// ra-rb > d : ??????
		cout << a << endl;
	}
	return 0;
}