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

float d(float x, float y, float z, float w){
	float ret;
	ret = pow(x - z, 2) + pow(y - z, 2);
	return sqrtf(ret);
}

int main(){
	int n,c;
	float x[2], y[2], r[2], dd;
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dd = d(x[0], y[0], x[1], y[1]);
		if(dd>r[0]+r[1]){
			cout << 0 << endl;
		}
		else{
			if(dd + r[0] <= r[1] || dd + r[1] <= r[0]){
				cout << 2 << endl;
			}
			else
			{
				cout << 1 << endl;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

const double EPS = 1.0e-10;

int main()
{
    int n;
    cin >> n;
    while(n-- > 0){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double len = sqrt(pow(xa-xb, 2.0) + pow(ya-yb, 2.0));
        if(len < ra - rb + EPS)
            cout << 2 << endl;
        else if(len < rb - ra + EPS)
            cout << -2 << endl;
        else if(len < ra + rb + EPS)
            cout << 1 << endl;
        else
            cout << 0 << 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 = (x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]);
        double rr = (r[0] + (r[1]) * (r[0] + r[1]);
        if(rr <= 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 <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 <complex>
#include <iostream>
using namespace std;
typedef complex<double> P;
int main() {
  int n; cin >> n;
  while(n--) {
    double ra,rb;
    double x1,y1,x2,y2;
    cin >> x1>>y1>>ra>>x2>>y2>>rb;
    P a(x1,y1), b(x2,y2);
    double d = abs(a-b);
    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;
  }
}

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;
}

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    D xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    P a = P(xa, ya);
    P b = P(xb, yb);

    if (ra+rb < abs(a-b)) {
      std::cout << 0 << std::endl;
    }else if (ra+abs(a-b) < rb) {
      std::cout << -2 << std::endl;
    }else if (rb+abs(a-b) < ra) {
      std::cout << 2 << std::endl;
    }else {
      std::cout << 1 << std::endl;
    }
  }

  
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        float x[2], y[2], r[2];
        
        for(int j = 0; j < 2; j++)
            cin >> x[j] >> y[j] >> r[j];
        
        // 2??????????????????????????¢
        float d = sqrt((x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0]));
        float r = r[0] + r[1];
        int ans;
        if(d > r) ans = 0;
        else if(d >= fabs(r[1]-r[0]) && d <= r) ans = 1;
        else{
            if(max(r[0],r[1] == r[0])) ans = 2;
            else ans = -2;
        }
        cout << ans << endl;
    }
}

C++: #include<iostream>

using namespace std;


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

circle c[2];


bool isIn(circle a, circle b){
  return (b.x+b.r < a.x+a.r && b.y+b.r < a.y+a.r &&
	  b.x-b.r > a.x-a.r && b.y-b.r > a.y-a.r);
}

bool cross(circle a, circle b){
  double diff = (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
  return diff <= (a.r+b.r)*(a.r+b.r);
}
int solve(){

  if(isIn(c[0],c[1])) return 2;
  else if(isIn(c[1],c[0]))return -2;
  else if(cross(c[0],c[1])) return 1;
  else return 0;
}

int main(){

  int n;
  cin >> n;
  while(n--){
    for(int i = 0; i < 2; i++)
      cin >> c[i].x >> c[i].y >> c[i].r;

    cout << solve() << endl;
  }
  return 0;
}