Go: package main

import (
        "fmt"
        "math"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                var ax, ay, ar, bx, by, br float64
                fmt.Scanf("%f %f %f %f %f %f", &ax, &ay, &ar, &bx, &by, &br)

                d := math.Sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay))
                if d <= ar + br {
                        if ar > br {
                                if ar > br + d {
                                        fmt.Println("2")
                                } else {
                                        fmt.Println("1")
                                }
                        } else {
                                if br > ar + d {
                                        fmt.Println("-2")
                                } else {
                                        fmt.Println("1")
                                }
                        }
                } else {
                        fmt.Println(0)
                }
        }
}

C++: #include<iostream>
#include<math.h>
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 rsum = (ra+rb)*(ra+rb), rdiff = ra-rb;
        double cntr_dst = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if(rdiff>0 && rdiff*rdiff>cntr_dst){
            cout << 2;
        }else if(rdiff<0 && rdiff*rdiff>cntr_dst){
            cout << -2;
        }
        else if(rsum>cntr_dst && cntr_dst>fabs(rdiff)){
            cout << 1;
        }
        else if(rsum<cntr_dst){
            cout << 0;
        }
        cout << endl;
    }
    return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb,d;
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    // BがAの中にあるとき
    if(ra>rb && d < fabs(ra + rb)){
      cout << 2 << endl;
    } // AがBの中にあるとき
    else if(ra<rb && d < fabs(ra + rb)){
      cout << -2 << endl;
    } // 円周が交わってる
      else if(d == fabs(ra + rb)){
      cout << 1 << endl;
    } // 重なってないとき
      else if(d >  fabs(ra + rb)){
      cout << 0 << endl;
    }
  }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  double n,xa,ya,ra,xb,yb,rb,d,X,Y;
  cin >> n ;
  for(int i=0;i<n;i++){
  cin >> xa >> ya >> ra >> xb >> yb >> rb ;
  X=(xa-xb)*(xa-xb);
  Y=(ya-yb)*(ya-yb);
  d=sqrt(X+Y);

  if(d <ra-rb){
    cout << 2<< endl;}
  else if(d <rb-ra){
    cout << -2 << endl;}
  else if(d <ra+rb && (d>rb-ra || d >ra-rb) ){
    cout << 1 << endl;}
  else if(d > ra+rb){
    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-2;

#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 d2 = dot(c1-c2,c1-c2);
  double prr = (r1+r2)*(r1+r2);
  double mrr = (r1-r2)*(r1-r2);
  if(GE(d2 ,prr)) return 0;
  else if(GE(mrr, d2)) {
    if(r1 > r2) return 2;
    else 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 <algorithm>
#include <cmath>
#define EPS 0.000000001
using namespace std;

double X[2][60],Y[2][60],R[2][60];
int res[60];
int main(){
	int N;
	cin>>N;
	for(int i=1;i<=N;i++){
		for(int j=0;j<2;j++){
			cin>>X[j][i]>>Y[j][i]>>R[j][i];
		}
	}

	double re;
	for(int i=1;i<=N;i++){
		re=pow(X[0][i]-X[1][i],2)+pow(Y[0][i]-Y[1][i],2);
		if(re>=pow(R[0][i]+R[1][i],2)){
			res[i]=0;
		}
		else if(re>pow(R[0][i]-R[1][i],2)){
			res[i]=1;
		}
		else if(R[0][i]>R[1][i]){
			res[i]=2;
		}
		else res[i]=-2;
	}
	for(int i=1;i<=N;i++){
		cout<<res[i]<<endl;
	}
	return 0;
}

C++: #include <iostream>

using std::cin;

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

double pow2(double x);

int main()
{
    int data_num;
    cin >> data_num;

    while (data_num--) {
        Circle a, b;
        cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;

        double dist = pow2(a.x - b.x) + pow2(a.y - b.y);

        int ans;
        if (dist > pow2(a.r + b.r)) {
            ans = 0;
        } else if (dist >= pow2(a.r - b.r)) {
            ans = 1;
        } else {
            ans = (a.r > b.r)? 2: (-2);
        }

        std::cout << ans << std::endl;
    }

    return 0;
}

double pow2(double x)
{
    return (x * x);
}

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

int main(){

	std::array<double, 3> a; //0:xa 1:ya 2:ra
	std::array<double, 3> b;

	int N;
	std::cin >> N;

	for(int i = 0; i < N; ++i){
		
		for(int j = 0; j < 3; ++j)
			std::cin >> a[j];

		for(int j = 0; j < 3; ++j)
			std::cin >> b[j];

		double ab = hypot( (a[0] - b[0]) , (a[1] - b[1]) ); //distance a,b

		if( ab > (a[2] + b[2]) ) std::cout << 0 << std::endl;
		
		else if ( a[2] > ab + b[2] ) std::cout << 2 << std::endl;

		else if ( b[2] > ab + a[2] ) std::cout << -2 << std::endl;

		else std::cout << 1 << std::endl;

	}
	return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

int main(){
    int mod=1000000007;
    int n;
    int ans;
    double xa,ya,ra,xb,yb,rb;
    scanf("%d",&n);
    for (int i=0;i<n;i++) {
        scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
        double tmp=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        if ((tmp+rb)<ra) {
            printf("2\n");
        } else if ((tmp+ra)<rb) {
            printf("-2\n");
        } else if ((tmp)>(ra+rb)) {
            printf("0\n");
        } else {
            printf("1\n");
        }
    }
    return 0;
}