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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

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

int main()
{
	std::uint32_t n;
	std::cin >> n;
	for (std::uint32_t i = 0; i < n; ++i) {
		double x_a, y_a, r_a, x_b, y_b, r_b;
		std::cin >> x_a >> y_a >> r_a >> x_b >> y_b >> r_b;
		double const dist = std::hypot(x_a - x_b, y_a - y_b);
		if (dist + r_b < r_a) {
			std::cout << 2 << std::endl;
		}
		else if (dist + r_a < r_b) {
			std::cout << -2 << std::endl;
		}
		else if (dist <= r_a + r_b) {
			std::cout << 1 << std::endl;
		}
		else {
			std::cout << 0 << std::endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

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 dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist)
			cout<<0<<endl;
		// ~üªðíé
		else if(EQ(abs(ra-rb)*abs(ra-rb),dist)||((abs(ra-rb))*(abs(ra-rb))<dist&&(ra+rb)*(ra+rb)>dist))
			cout<<1<<endl;
		else if(abs(ra-rb)*abs(ra-rb)>dist){
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
		}
		else
			cout<<1<<endl;
	}

	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
struct circle{
  double x,y,r;
};
int main(){
  int n;
  circle p[2];
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> p[0].x >> p[0].y >> p[0].r >> p[1].x >> p[1].y >> p[1].r;
    double l = sqrt((p[0].x-p[1].x)*(p[0].x-p[1].x) + (p[0].y-p[1].y)*(p[0].y-p[1].y));
    if(fabs(p[0].r-p[1].r) > l ){
      if(p[0].r>p[1].r){ cout <<"2"<< endl;}
      else cout << "-2"<<endl;
    }
    if(fabs(p[0].r-p[1].r) < l && fabs(p[0].r+p[1].r) > l ){
	cout << "1" << endl;
      }
      if(fabs(p[0].r+p[1].r) < l){
	cout <<"0" <<endl;
      }
  }
}

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>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)>(ra+rb)*(ra+rb))
	{
	  if(xa < xb+rb && xa>xb-rb && ya < yb+rb && ya>yb-rb && ra > rb)
	    ans =2;
	  else if (xb < xa+ra && xb>xa-rb && yb < ya+rb && yb>ya-rb && rb > ra)
	    ans =-2;	
	  else
	    ans = 0;
	}
      else
	{
	  if(xa < xb+rb && xa>xb-rb && ya < yb+rb && ya>yb-rb && ra > rb)
	    ans =2;
	  else if (xb < xa+ra && xb>xa-rb && yb < ya+rb && yb>ya-rb && rb > ra)
	    ans =-2;
	  else
	    ans =-1;
	}

      cout<<ans<<endl;

    }

}

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

using namespace std;

int check(double *l, double *s);

int main()
{
	int n, ans;
	double a[3], b[3];	//[0]:x[1]:y[2]:r

	cin >> n;

	for (int i=0; i<n; i++)
	{
		cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];

		if(a[2] > b[2]) {		//aを大きい円、bを小さい円としたとき
			ans = check(&a[0], &b[0]);
		}
		else {					//bを大きい円、aを小さい円としたとき
			ans = check(&a[0], &b[0]);
			ans *= (ans == 2) ? -1 : 1;		//aがbの中にあるときの処理
		}

		cout << ans << endl;
	}

	return 0;
}

int check(double *l, double *s)	//円の重なり・内外を判定
{
	double d = (l[0]-s[0])*(l[0]-s[0]) + (l[1]-s[1])*(l[1]-s[1]);

	d = sqrt(d);

	if(d <= l[2]-s[2]) {	//小さい円が大きい円の内側にあるとき
		return 2;
	}
	else if(l[2]-s[2] < d && d < l[2]+s[2]) {	//円周が交わっているとき
		return 1;
	}
	else {
		return 0;	//外側にあるとき
	}
}

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( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) <= (ra-rb)*(ra-rb) && rb < ra )
			printf("2\n");
		//AがB中にあるか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) <= (ra-rb)*(ra-rb) && ra < rb )
			printf("-2\n");
		//AとBが交わっているか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra+rb)*(ra+rb) )
			printf("1\n");
		else
			printf("0\n");
	}
	return 0;
}

C++: #include <cmath>
#include <cstdio>
#define eps 1e-8
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 + eps) {
			printf("0\n");
		}
		else if(dist <= ra - rb - eps) {
			printf("2\n");
		}
		else if(dist <= rb - ra - eps) {
			printf("-2\n");
		}
		else  {
			printf("1\n");
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

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

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

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

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

int main(){
	double x[2];
	double y[2];
	double r[2];
	double dist;
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dist = hypot(x[0] - x[1], y[0] - y[1]);
		if(r[0] > dist + r[1]){
			printf("2\n");
		}else if(r[1] > dist + r[0]){
			printf("-2\n");
		}else if(r[0] + r[1] < dist){
			printf("0\n");
		}else{
			printf("1\n");
		}
	}
	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);
    if(r+ra <= rb) printf("-2\n");
    else if(rb-ra > r && rb>ra) printf("2\n");
    else if(ra-rb > r && ra>rb) printf("1\n");
    else printf("0\n");
  }
}