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 <cmath>
#include <deque>

inline double distance(double x1,double y1,double x2,double y2){
	return sqrt( (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) std::cout << "0"; //number.push_back(0);
		//"2" if B is in A
		else if(ra > rb && (dis + rb <= ra) ) std::cout << "2"; //number.push_back(2);
		//"-2" if A is in B
		else if(rb > ra && (dis + ra <= rb) ) std::cout << "-2"; //number.push_back(-2);
		//"1" if circumference of A and B intersect
		else std::cout << "1";//number.push_back(1);
		std::cout << std::endl;
	}
	
	/*
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	*/
	return 0;
	}

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

struct Point{
    Point(void){
        x=y=r=0;
    }
    double x,y;
    double r;
};

double d(struct Point a,struct Point b){
    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}

int main(void){
    int n;
    std::cin>>n;
    struct Point a,b;
    for(int i=0;i<n;i++){
        int judge;
        std::cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
        double d=d(a,b);
        if(d+b.r<a.r)
            judge=2;
        else if(d+a.r<b.r)
            judge=-2;
        else if(d<=a.r+b.r)
            judge=1;
        else
            judge=0;
        std::cout<<judge<<std::endl;
    }
    return 0;
}

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

int collision_detection(double x1, double y1, double x2, double y2, double r1, double r2){
	double d = ((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
	double sr = ((r1+r2)*(r1+r2));
	double dr = ((r1-r2)*(r1-r2));
	if( d > sr ){
		return 0;
	}else if( d <= sr && dr <= d){
		return 1;
	}else if(dr > d){
		return (r1>r2)? 2 : -2;
}
}

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

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

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; cin >> 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 <stdio.h>
#include <math.h>

int main()
{
	int n, t;
	double x1, y1, r1, x2, y2, r2;
	double d;

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);

		d = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
		if (d >= r1 + r2) t = 0;
		else if (d == r1 + r2 || d == fabs(r1 - r2)) t = 1;
		else if (d + r1 > r2) t = 2;
		else if (d + r2 > r1) t = -2;

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

	return 0;
}

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

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

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


int n;
double xa, ya, ra;
double xb, yb, rb;


int solve(){
	double d = (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya);
	
	if((rb-ra)*(rb-ra) <= d && d <= (rb+ra)*(rb+ra)) return 1;
	if((rb+ra)*(rb+ra) < d) return 0;
	if(sqrtl(d) < (ra-rb)) return 2;
	if(sqrtl(d) < (rb-ra)) return -2;
	return 3;
}


int main(){
	cin >> n;
	int i = 0;
	while(cin >> xa >> ya >> ra >> xb >> yb >> rb, i < n){
		cout << solve() << endl;
		i++;
	}

	return 0;
}

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

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

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

int main()
{
	int n;
	std::cin >> n;
	
	while( n-- ){
	 	double x[2], y[2], r[2];
		for( int i = 0; i < 2; i++ ){
			std::cin >> x[i] >> y[i] >> r[i];
		}
		
		if( fabs( x[0] - x[1] ) > r[0] + r[1] ){
		 	puts("0");
		}
		else if( sqrt( pow( x[1] - x[0], 2 ) + pow( y[1] - y[0], 2 ) ) <= fabs( r[0] - r[1] ) ){
			std::cout << (  r[0] > r[1] ? 1 : -1 ) * 2 << std::endl;
		}
		else{
			puts("1");
		}
	}

 	return 0;
}

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

int main(void)
{
  int N;
  scanf("%d", &N);

  int i;
  for (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 distance = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
    int result;
    if (distance > ra + rb) {
      result = 0;
    }
    else if (distance < ra - rb) {
      result = 2;
    }
    else if (distance < rb - ra) {
      result = -2;
    }
    else {
      result = 1;
    }

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

  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<add(r[0],-r[1])) ans=2; //dist<r[0]-r[1]
		else if(dist<add(r[1],-r[0])) ans=-2; //dist<r[1]-r[0]
		else if(add(dist,-add(r[0],r[1])) <=0 ) ans=1; //dist<=r[0]+r[1]
		cout << ans << '\n' ;
	}
}

C++: #include <stdio.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 (fabs(ra - rb) <= d) {
					rt = 1;
				} else if (ra - rb > d) {
					rt = 2;
				} else {
					rt = -2;
				}

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

	return 0;
}