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 <cstdlib>
#include <cmath>
using namespace std;

struct circle
{
    double x;
    double y;
    double r;
};

double getDistance(circle a, circle b)
{
    return sqrt(pow(a.x - b.x ,2)
            +pow(a.y - b.y ,2));
}

int main()
{
    int n;
    circle a, b;
    double distance;
    for(int c = 0; c < n; c++)
    {
        cin >> a.x >> a.y >> a.r
            >> b.x >> b.y >> b.r;
        distance = getDistance(a, b);
        if(abs(a.r + b.r) > distance)
            cout << 0 << endl;
        else if(a.r - b.r > distance)
            cout << 2 << endl;
        else if(abs(a.r - b.r) < distance && a.r + b.r > distance)
            cout << 1 << endl;
        else if(b.r - a.r > distance)
            cout << -2 << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <vector>
#include <cmath>
#include <set>
using namespace std;
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<n;i++)

class C{
public:
	double x;
	double y;
	double r;
};

double euc(C a,C b){
	a.x -= b.x;
	a.y -= b.y;
	return sqrt(a.x*a.x+a.y*a.y);
}

int main(){
	int n;
	C a,b;
	cin >> n;
	while(n--){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		if( euc(a,b)+b.r <= a.r && a.r > b.r ){
			cout << 2 << endl;
		
		}else if( euc(a,b)+a.r <= b.r && b.r > a.r ){
			cout << -2 << endl;
		}else if(euc(a,b) < b.r ){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
}

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

int main(){
	int n;
	cin >> n;
	for(; n--; ){
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));

		if(d+rb < ra) cout << 2 << endl;
		else if(d+rb == ra) cout << 1 << endl;
		else if(d+ra < rb) cout << -2 << endl;
		else if(d+ra == rb) cout << 1 << endl;
		else if(d <= ra+rb) cout << 1 << endl;
		else cout << 0 << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		long double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		long double d = hypot(xa - xb, ya - yb);
		if (d < abs(ra - rb))
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
		else if (d <= ra + rb)
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 0 << std::endl;
		}
	}
	return 0;
}

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

int main(void)
{
    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(pow((xa-xb),2.0) + pow((ya-yb),2.0));
        if (d + ra < rb)
            cout << -2;
        else if(d + rb < ra)
            cout << 2;
        else if (d <= ra + rb)
            cout << 1;
        else
            cout << 0;
        cout << endl;
    }
    return 0;
}

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

using namespace std;

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

    cin >> n;
    while ( n-- ) {
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
        /*
        2 ,原点同士の距離+r1 < r2
        -2,原点同士の距離+r2 < r1
        1 ,原点同士の距離 >= r1 + r2
        0 ,else

        a^2 = b^2 + c^2

        */
        double dx, dy, dis;
        dx = abs(x2-x1);
        dy = abs(y2-y1);
        dis = sqrt(pow(dx, 2) + pow(dy, 2));
        cout << dis << " " << dx << " " << dy << " " << r1 + r2 << endl;
        if ( dis + r2 < r1 ) {
            cout << 2;
        } else if ( dis + r1 < r2 ) {
            cout << -2;
        } else if ( r1 + r2 > dis ) {
            cout << 1;
        } else {
            cout << 0;
        }
        cout << endl;
    }

    return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


#define X real()
#define Y imag()
typedef complex<double> P;

int main(){
	  
	int n;
	cin>>n;
	rep(i,n){	
		double xa,ya,ra,xb,rb,yb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		
		P a = P(xa,ya);
		P b = P(xb,yb);
		
		double c = abs(a-b);
		
		if(c<=ra && c<=rb){
			if(ra>rb)puts("2");
			else puts("-2");
			continue;
		}
		if(ra+rb<c){
			puts("0");
			continue;
		}
		puts("1");
	}
	
}

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

int solve(long double d,long double ra,long double rb){
  if(ra+rb<d){
    return 0;
  }else if(ra+d<rb){
    return -2;
  }else if(rb+d<ra){
    return 2;
  }else{
    return 1;
  }
  assert(0);
  return -100;
}



int main(){
  long 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;
    cout<<solve(sqrt(pow(ya-yb,2)+pow(xa-xb,2)),ra,rb)<<endl;
  }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
struct circle{
  double x;
  double y;
  double r;
};
  int inclusion(circle,circle);
int main(){
  int n;
  circle a,b;
  cin >> n;
  for(;n;n--){
    cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
    cout<<inclusion(a,b)<<endl;
  }
  return 0;
}

int inclusion(circle a,circle b){
  double distance = sqrt( pow(b.x-a.x,2)+pow(b.y-a.y,2));
  circle d;
  int abs;
  if(a.r>b.r)abs=1;
  else
    abs=-1,d=a,a=b,b=d;
  if(distance<=a.r+b.r){
    //ツ陛ッツ甘慊つオツづつ「ツづ慊つキツ。
    if(distance<a.r){
      return 2*abs;
    }
    else{
      return 1;
    }
  }
  else{
    //ツ陛ッツ甘慊つオツづつ「ツづ慊つケツづアツ。
    return 0;
  }
}
/*
Sample Input
2
0.0 0.0 5.0 0.0 0.0 4.0
0.0 0.0 2.0 4.1 0.0 2.0
Output for the Sample Input
2
0
*/

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r = pow(pow(xb - xa, (float)2.0) + pow(yb - ya, (float)2.0), (float)1.0/2);
		if (r > ra + rb) {
			cout << 0 << endl;
		}
		else if (r <= ra + rb) {
			if (ra >= rb) {
				if (r < ra - rb) {
					cout << 2 << endl;
				}
				else if (r >= ra - rb) {
					cout << 1 << endl;
				}
			}
			else if (ra < rb) {
				if (r <rb - ra) {
					cout << -2 << endl;
				}
				else if (r >= rb - ra) {
					cout << 1 << endl;
				}
			}
		}
	}
	return 0;
}