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 <stdlib.h>
#include <math.h>

int
main(void)
{
	char line[80];
	int n;
	double xa, ya, ra, xb, yb, rb;
	
	while (fgets(line, sizeof line, stdin)) {
		if (sscanf(line, "%d", &n) == 1) {
			for (int i = 0; i < n; i++) {
				if (fgets(line, sizeof line, stdin) == NULL) {
					return 1;
				}
				if (sscanf(line, "%lf %lf %lf %lf %lf %lf",
						   &xa, &ya, &ra, &xb, &yb, &rb) != 6) {
					return 1;
				}

				double d = sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya));
				
				int rt;
				if (ra + rb < d) {
					rt = 0;
				} else if (abs(ra - rb) < d && d <= ra + rb) {
					rt = 1;
				} else if (ra - rb >= d) {
					rt = 2;
				} else {
					rt = -2;
				}

				printf("%d\n", rt);
			}
		}
	}

	return 0;
}

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

using namespace std;

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

C++: #include <cstdio>
#include <complex>
#include <vector>
#include <cmath>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-4;

#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)
#define LE(x,y) (x < y + EPF)
#define GE(x,y) (x + EPF > y)

double dot(P a, P b) {
  return (conj(a)*b).X;
}
double cross(P a, P b) {
  return (conj(a)*b).Y;
}
int isparallel(P a, P b, P c, P d) {//ab,cd
  return EQ(cross(a-b, c-d),0);
}
double distPP(P a, P b) {
  return sqrt(dot(a-b,a-b));
}
int relationCC(P c1, double r1, P c2, double r2) {//0..not overlap, 1..intersect, 2..2isin1, -2..1isin2
  double d = distPP(c1,c2);
  if(GE(d ,r1+r2)) return 0;
  else if(GE(r1, d+r2)) return 2;
  else if(GE(r2, d+r1)) return -2;
  else return 1;
}
P intersection(P a, P b, P c, P d) {//ac , bd
  double d1 = cross(d-b,b-a);
  double d2 = cross(d-b,c-a);
  if(EQ(d1,0) & EQ(d2,0)) return a;
  if(EQ(d2,0)) return a;
  return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
  P b(-a.Y, a.X);
  return b;
}
P polar(double r, double theta) {
  P a(r*cos(theta),r*sin(theta));
  return a;
}


int main() {
  int n;
  scanf("%d",&n);
  REP(i,n) {
    double x,y,r1,r2;
    scanf("%lf %lf %lf", &x, &y, &r1);
    P a(x,y);
    scanf("%lf %lf %lf", &x, &y, &r2);
    P b(x,y);
    printf("%d\n", relationCC(a,r1,b,r2));
  }
  return 0;
}

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

struct Circle {
    const double x, y, r;
    Circle(const double x, const double y, const double r)
        :x(x), y(y), r(r) {};
    ~Circle() = default;
    bool include(Circle &C);
};

inline double distance(Circle &A, Circle &B) {
    return std::sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}

bool Circle::include(Circle &C) {
    auto d = distance(*this, C);
    return (d*d < (r - C.r)*(r - C.r) && r > C.r);
}

int circles_intersection(Circle &A, Circle &B) {
    auto d = distance(A, B);
    if (d > A.r + B.r)      return  0;
    else if (A.include(B))  return  2;
    else if (B.include(A))  return -2;
    else                    return  1;

}

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

    std::cin >> n;
    for (u_int i = 0; i < n; ++i) {
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        Circle A(xa, ya, ra), B(xb, yb, rb);
        std::cout << circles_intersection(A, B) << std::endl;
    }

    return 0;
}

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

 
 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 <math.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	double xa,ya,ra,xb,yb,rb;
	for(int i=0;i<n;i++){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double l = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
		if(l>ra+rb){
			cout<<"0"<<endl;
		}else if(l<rb-ra && l>ra-rb){
			cout<<"-2"<<endl;
		}else if(l<ra-rb && l>rb-ra){
			cout<<"2"<<endl;
		}else{
			cout<<"1"<<endl;
		}
	}
	return 0;
}

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

int main(){
	int n;
	double xa,ya,ra,xb,yb,rb;
	double L;
	int i;
	
	scanf("%d",&n);
	
	for(i = 0;i < n;i++){
		scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
		L = sqrt(pow(xa-xb,2) + pow(ya-yb,2));
		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;
}