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<stdio.h>
#include<math.h>
#define EPS 1e-9
int n;
double xa,ya,ra,xb,yb,rb;

int main(){
	int i;
	scanf("%d",&n);
	
	for( i = 0;i < n;i++ ){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		//BがA中にあるか(境界ふくまない)
		if( sqrt( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) + sqrt(rb*rb) + EPS < ra )
			puts("2");
		//AがB中にあるか(境界ふくまない)
		else if( sqrt( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) + sqrt(ra*ra) + EPS < rb )
			puts("-2");
		//AとBが交わっているか(境界ふくまない)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra+rb)*(ra+rb) )
			puts("1");
		else
			puts("0");
	}
	return 0;
}

C++: #include <cmath>
#include <cstdio>
int n; long double xa, ya, ra, xb, yb, rb;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%Lf%Lf%Lf%Lf%Lf%Lf", &xa, &ya, &ra, &xb, &yb, &rb);
		long double dist = sqrtl((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if(dist >= ra + rb - 1e-12) {
			printf("0\n");
		}
		else if(dist <= ra - rb + 1e-12) {
			printf("2\n");
		}
		else if(dist <= rb - ra + 1e-12) {
			printf("-2\n");
		}
		else  {
			printf("1\n");
		}
	}
	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++: #include<iostream>
#include<cmath>
using namespace std;
struct Circle { long double x, y, r; };
int solve(Circle c, Circle d) {
	long double dist = (c.x - d.x)*(c.x - d.x) + (c.y - d.y)*(c.y - d.y);
	dist = sqrt(dist);
	long double dist2 = d.r + dist;
	if (dist2 < c.r) { return 2; }
	long double dist3 = c.r + dist;
	if (dist3 < d.r) { return -2; }
	long double dist4 = c.r + d.r;
	if (dist4 < dist) { return 0; }
	return 1;
}
int main() {
	Circle a, b; int n;
	for (int i = 0; i < n;i++){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		cout << solve(a, b) << endl;
	}
	return 0;
}

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

float d(float x, float y, float z, float w){
	float ret;
	ret = pow(x - z, 2) + pow(y - w, 2);
	return sqrtf(ret);
}

int main(){
	int n,c;
	float x[2], y[2], r[2], dd;
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dd = d(x[0], y[0], x[1], y[1]);
		if(dd>r[0]+r[1]){
			cout << 0 << endl;
		}
		else{
			if(dd + r[0] <= r[1]){
				cout << -2 << endl;
			}
			else if (dd + r[1] <= r[0]) {
				cout << 2 << endl;
			}
			else {
				cout << 1 << endl;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 2;

int main(){
    int n;
    cin >>n;
    REP(z, n){
        double x[N], y[N], r[N];
        REP(i, N) cin >>x[i] >>y[i] >>r[i];
        double d = sqrt((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]));
        if(r[0] + r[1] < d) cout <<0 <<endl;
        else if(r[0] > r[1] && d < r[0] - r[1]) cout <<2 <<endl;
        else if(r[1] > r[0] && d < r[1] - r[0]) cout <<-2 <<endl;
        else cout <<1 <<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int N;
	cin>>N;
	while(N--){
		int ans;
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double x;
		x=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(x>(ar+br))ans=0;
		else if(abs(ar-br)<=x&&x<=(ar+br))ans=1;
		else if(x<abs(ar-br)&&ar>br)ans=2;
		else ans=-2;
		cout<<ans<<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 (rb > ra && d <= rb - ra){
			cout << -2 << endl;
		}
		else if (ra > rb && d <= ra - rb){
			cout << 2 << endl;
		}
		else if (d > ra + rb){
			cout << 0 << endl;
		}
		else{
			cout << 1 << endl;
		}
	}
	return 0;
}

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

using namespace std;

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

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

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<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double pitagoras(double x1,double y1,double x2,double y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

main(){
  int n;
  scanf("%d",&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 r=pitagoras(xa,ya,xb,yb);
    printf("%lf %lf %lf\n",r,ra,rb);
    if(r+ra < rb) printf("-2\n");
    else if(r+rb < ra) printf("2\n");
    else if(ra+rb >= r) printf("1\n");
    else printf("0\n");
  }
}

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

int main(){
	int n;
	float xa,ya,ra,xb,yb,rb;
	float L;
	int i;
	
	scanf("%d",&n);
	
	for(i = 0;i < n;i++){
		scanf("%f %f %f %f %f %f",&xa,&ya,&ra,&xb,&yb,&rb);
		L = sqrt(pow(xa-xb,2) + pow(ya-yb,2));
		printf("%f\n",L);
		if(L > ra+rb){
			printf("0\n");
		}else if(L >= fabs(ra-rb)&&L <=ra+rb){
			printf("1\n");
		}else if(L < fabs(ra-rb)){
			if(ra > rb){
				printf("2\n");
			}else{
				printf("-2\n");
			}
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
double EPS=1e-10;
double add(double a, double b)
{
	if(abs(a+b)<EPS*(abs(a)+abs(b)) ) return 0;
	else return a+b;
}
int main()
{
	int n ; cin >> n ;
	while(n--)
	{
		double x[2],y[2],r[2];
		for(int i=0;i<2;i++) cin >> x[i] >> y[i] >> r[i] ;
		double dist=sqrt( add( (x[1]-x[0])*(x[1]-x[0]),(y[1]-y[0])*(y[1]-y[0]) ) );
		int ans=0;
		if(dist<r[0]) ans=2;
		else if(dist<r[1]) ans=-2;
		else if(dist<=add(r[0],r[1])) ans=1;
		cout << ans << '\n' ;
	}
}