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 <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int n;
double x_1, y_1, r_1, x_2, y_2, r_2;

int main() {
	scanf( "%d", &n );
	for ( int i = 0; i < n; i++ ) {
		scanf( "%lf %lf %lf %lf %lf %lf", &x_1, &y_1, &r_1, &x_2, &y_2, &r_2 );
		int ans = 0;
		double _range = sqrt( sq( x_1 - x_2 ) + sq( y_1 - y_2 ) );
		if ( _range <= r_1 + r_2 - EPS) {
			ans = 1;
			if ( _range + r_1 <= r_2 - EPS ) {
				ans = -2;
			}
			else if ( _range + r_2 <= r_1 - EPS) {
				ans = 2;
			}
		}
		printf( "%d\n", ans );
	}
	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) {
			if (ar > br)
				cout << "2" << endl;
			else
				cout << "-2" << endl;
		}
		
	}
	
	return 0;
}

C++: #include<iostream>
#include<cmath>
int main()
{
    int n;
    std::cin >> n;
    for (int i = 0; i < n; i++)
    {
        double xa, ya, ra, xb, yb, rb;
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = hypot(xa - xb, ya - yb);
        if (d < std::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>

int main(){
	
	int num;
	
	std::cin >> num;  //dataset
	
	double xa,ya,ra;
	double xb,yb,rb;
	
	for(int i=0; i<num; ++i){
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		double length;  //a-b length;
		
		length = hypot(std::abs(xa-xb), std::abs(ya-yb));
		
		if(length > ra+rb){
			std::cout << 0 << std::endl;
		}else if(length + rb < ra){
			std::cout << 2 << std::endl; 
		}else if(length + ra < rb){
			std::cout << -2 << std::endl; 
		}else{
			std::cout << 1 << std::endl; 
		}
	}	
	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#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++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

int circle(double ra, double rb, double d){
	if((ra+rb)<d){
		return 0;
	}else{
		if(ra>(d+rb)){
			return 2;
		}else if(rb>(d+ra)){
			return -2;
		}else{
			return 1;
		}
	}
}

int main(){
	ios::sync_with_stdio(false);

	double a[2], b[2];
	double ra, rb;

	int n;
	scanf("%d", &n);

	while(n--){
		scanf("%lf %lf %lf %lf %lf %lf", &a[0], &a[1], &ra, &b[0], &b[1], &rb);

		double d=sqrt((b[0]-a[0])*(b[0]-a[0])+(b[1]-a[1])*(b[1]-a[1]));

		printf("%d\n", circle(ra, rb, d));
	}
}

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

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

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> ar >> bx >> by >> br;

    dis = sqrt( (ax-bx)*(ax-bx) + (ay-by)*(ay-by) );
    if( dis < ar - br)cout << 2 << endl;
    else if( dis < br - ar)cout << -2 << endl;
    else if( dis < ar + br)cout << 1 << endl;
    else cout << 0 << endl;
  }
}

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

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

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> ar >> bx >> by >> br;

    dis = sqrt( (ax-bx)*(ax-bx) + (ay-by)*(ay-by) );
    if( dis - ar + br < 1e-10)cout << 2 << endl;
    else if( dis - br + ar < 1e-10)cout << -2 << endl;
    else if( dis > ar + br)cout << 0 << endl;
    else cout << 1 << endl;
  }
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>
#include <vector>
#define P(a) ((a)*(a))
using namespace std;

int main(){
    double xa,ya,ra,xb,yb,rb,dist;
    int n;
    cin >> n;
    while(n--){
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        dist=sqrt(P(xb-xa)+P(yb-ya));
        if(ra>rb&&fabs(ra-rb)>dist) cout << "2" << endl;
        else if(ra<rb&&fabs(ra-rb)>dist) cout << "-2" << endl;
        else if(dist<=ra+rb&&fabs(ra-rb)<=dist) cout << "1" << endl;
        else cout << "0" << endl;
    }
    return 0;
}