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<complex>
#include<cmath>
#include<map>
#define fs first
#define sc second
#define EPS 0
using namespace std;


typedef complex<double> P;
typedef pair<P,int> C;

int cpr(C a,C b){
  double d = abs(a.fs-b.fs);
  if(a.sc+b.sc + EPS < d)return -1;      //no intersection (outside)
  if(b.sc<a.sc && d + EPS < a.sc-b.sc)return 1;       //no intersection (inside,B in A)
  if(a.sc<b.sc && d + EPS < b.sc-a.sc)return 2;       //no intersection (inside,A in B)
  if(abs(a.sc+b.sc - d) < EPS)return -3; //one cross point (outside)
  if(abs(b.sc+d - a.sc) < EPS)return 3;  //one cross point (inside,B in A)
  if(abs(a.sc+d - b.sc) < EPS)return 4;  //one cross point (inside,A in B)
  return 0;                              //two cross point
}


int main(){
  double ax,ay,ar,bx,by,br;

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin>> ax >> ay >> ar >> bx >> by >> br;
    C a = C(P(ax,ay),ar), b = C(P(bx,by),br);
    int v = cpr(a,b);
    if(v==-1)cout <<  0 << endl;
    else if(v==1)cout << 2 << endl;
    else if(v==2)cout << -2 << endl;
    else cout << 1 << endl;
  }
}

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

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion


int main()
{
    int n;
    cin >> n;
    rep(i, n) {
        double x_a, y_a, r_a, x_b, y_b, r_b;
        cin >> x_a >>y_a >> r_a >> x_b >> y_b >> r_b;
        double dist = hypot(x_a - x_b, y_a - y_b);
        if (dist + r_b < r_a) P(2);
        else if (dist + r_a < r_b) P(-2);
        else if (dist <= r_a + r_b) P(1);
        else P(0);
    }
    return 0;
}

C++: #include <iostream>
#include <stack>
#include <stdio.h>
#include <cmath>
#include <utility>
using namespace std;
int main()
{
    int n;
	cin>>n;
	while(n--){
		int ans=0;
		double ax,ay,ar,bx,by,br,d;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		d=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(d<abs(ar-br)){//a)b||a(b
			ans=2;
			if(ar<br)ans*=-1;
		}else if(d<ar+br){
			ans=1;
		}
		cout<<ans<<endl;
	}
    return 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;
    cin >> n;
    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(a.r - b.r > distance)
            cout << 2 << endl;
        else if(abs(a.r + b.r) < distance)
            cout << 0 << 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;

        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>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(u-r1 <= r2 || u-r2 <= r1){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

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

int main(){
  int n;
  double xa,ya,ra,xb,yb,rb,d;
  std::cin >> n;

  for(int i=0;i<n;i++){
    std::cin >> xa >> ya >> ra
             >> xb >> yb >> rb;
    d = std::sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    if(ra+rb < d){
      std::cout << 0 << std::endl;
      break;
    }
    if(ra+d < rb){
      std::cout << -2 << std::endl;
      break;
    }
    if(rb+d < ra){
      std::cout << 2 << std::endl;
    }else{
      std::cout << 1 << std::endl;
    }
  }
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n; scanf("%d", &n);
	rep(i, n) {
		double x1, y1, r1, x2, y2, r2;
		scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &r1, &x2, &y2, &r2);
		double d = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
		if (d > r1 + r2)puts("0");
		else if (d <= r1 - r2)puts("2");
		else if (d <= r2 - r1)puts("-2");
		else puts("1");
	}
}