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




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

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

int main(){
	int N;
	double x_a,y_a,r_a,x_b,y_b,r_b,dist;
	scanf("%d",&N);
	for(int i=0;i<N;i++){
		scanf("%lf %lf %lf %lf %lf %lf",&x_a,&y_a,&r_a,&x_b,&y_b,&r_b);

		if(r_a > r_b){
			dist = sqrt((x_a -x_b)*(x_a-x_b)+(y_a-y_b)*(y_a-y_b));
			if(dist < (r_a-r_b))printf("2\n");
			else if(dist >= (r_a-r_b) && dist <= (r_a+r_b))printf("1\n");
			else{
				printf("0\n");
			}
		}else{	//r_a < r_b
			dist = sqrt((x_b -x_a)*(x_b-x_a)+(y_b-y_a)*(y_b-y_a));
			if(dist < (r_b-r_a))printf("-2\n");
			else if(dist >= (r_b-r_a) && dist <= (r_b+r_a))printf("1\n");
			else{
				printf("0\n");
			}
		}
	}

    return 0;
}

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

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

using namespace std;
// Problem:0023
int main()
{
	int n; double ax, ay, ar, bx, by, br, d, rPlus, rMinus;
	cin >> n;
	
	for (int i=0; i<n; i++) {
		cin >> ax >> ay >> ar >> bx >> by >> br;
		d = sqrt((ax - bx)*(ax - bx) + (ay - by)*(ay - by));
		rPlus = ar + br;
		rMinus = ar > br ? ar - br : br - ar;
		
		if (d > rPlus)
			cout << 0 << endl;
		else if (rPlus > d && d > rMinus)
			cout << 1 << endl;
		else if (d < rMinus)
			cout << (ar>br ? 2 : -2 )<< endl;
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

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

	return 0;
}

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

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

double di(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=di(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 <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <complex>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)

typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = (1e-10);    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) {
  return (conj(a)*b).Y;
}

VP crosspointCC(P a, D ar, P b, D br) {
  VP ps;
  P ab = b-a;
  D d = abs(ab);
  D crL = (norm(ab) + ar*ar - br*br) / (2*d);
  if (EQ(d, 0) || ar < abs(crL)) return ps;

  P abN = ab * P(0, sqrt(ar*ar - crL*crL) / d);
  P cp = a + crL/d * ab;
  ps.push_back(cp + abN);
  if (!EQ(norm(abN), 0)) ps.push_back(cp - abN);
  return ps;
}

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;
    P a = P(xa, ya);
    P b = P(xb, yb);

    if (GE(abs(a-b), ra+rb)) {
      std::cout << 0 << std::endl;
      continue;
    }

    VP vec = crosspointCC(a, ra, b, rb);
    if (vec.size() > 0) {
      std::cout << 1 << std::endl;
    }else if (GE(rb, abs(a-b)+ra)){
      std::cout << -2 << std::endl;
    }else {
      std::cout << 2 << std::endl;
    }
  }

  
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 2;

int main(){
    int n;
    cin >>n;
    REP(z, n){
        double x[N], y[N], r[N];
        REP(i, N) cin >>x[i] >>y[i] >>r[i];
        double d = sqrt((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]));
        if(r[0] + r[1] <= d) cout <<0 <<endl;
        else if(r[0] > r[1] && d < r[0] - r[1]) cout <<2 <<endl;
        else if(r[1] > r[0] && d < r[1] - r[0]) cout <<-2 <<endl;
        else cout <<1 <<endl;
    }
    return 0;
}

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

using namespace std;

int main() {
	int n, ans;
	float x1, y1, r1, x2, y2, r2, dis;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		dis = hypot(x2 - x1, y2 - y1);
		ans = 0;

		if (dis < r1 - r2) { ans = 2; }
		else if (dis< r2 - r1) { ans =  -2; }
		else if (r1 + r2 >= dis) { ans = 1; }

		cout << ans << endl;
	}
	return 0;
}

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

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

	return 0;
}