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;

int main()
{
	int number;
	double x1,y1,r1,x2,y2,r2,d;
	
	cin >> number;
	while(number--)
	{
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		d = sqrt((x2-x1) * (x2-x1) + (y2-y1) * (y2-y1));

		if(d > r1 + r2)
		{
			cout << 0 << endl;
		}
		else if(d < r1- r2)
		{
			cout << 2 << endl;
		}
		else if(d < r2-r1)
		{
			cout << -2 << endl;
		}
		else
		{
			cout << 1 << endl;
		}
	}
	return 0;
}

C++: 
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define roop(a,t) for(int a=0;a<t;a++) 
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	ld x[2], y[2], r[2];
	ll n;
	cin >> n;
	roop(i, n) {
		roop(lp, 2) {
			cin >> x[lp] >> y[lp] >> r[lp];
		}
		ld ab = sqrt((x[0] - x[1])*(x[0] - x[1]) + (y[0] - y[1])*(y[0] - y[1]));
		if (r[0] + r[1] < ab) { cout << 0 << endl; continue; }
		else if (r[0] + r[1] == ab) { cout << 1 << endl; continue; }
		else {
			if (r[0] > r[1]) {
				if (r[0] > r[1] + ab) { cout << 2 << endl; continue; }
			}
			else {
				if (r[1] > r[0] + ab) { cout << -2 << endl; continue; }
			}
		}cout << 1 << 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 > ra + rb)
		{
			std::cout << 0 << std::endl;
		}
		else if (d > abs(ra - rb))
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("-2");goto L;}
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("2");goto L;}
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        swap(a.first,a.second); swap(b.first,b.second);
        if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        puts("0");
    L:;
        
    }
}

C++: /* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 
                                                           
*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define print(x) cout << x << '\n'
#define Fi first
#define Se second

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define DEPS(i, a, n) for (int i = (a); i >= n; i--)
#define DEP(i, n) for (int i = (n); i >= 0; i--)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool is_uruu(int y) {return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;}
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}

/* }}} */

#define sq(x) ((x) * (x))

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;

  while (n--){
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(sq(xa - xb) + sq(ya - yb));

    if (d < fabs(ra - rb)){
      print("2");
    } else if (d < fabs(rb - ra)){
      print("-2");
    } else if (d <= ra + rb){
      print("1");
    } else {
      print("0");
    }
  }

  return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main() {
	int l[51];
	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 = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));
		if (distance <= abs(ra - rb)) {
			if (ra > rb)l[i] = 2;else l[i] = -2;
		}
		else if (distance > ra + rb)l[i] = 0;
		else l[i] = 1;
	}
	for (int i = 0; i < n; i++)
		cout << l[i] << endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
  
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
  
typedef long long ll;
typedef pair<int, int> ii;
 
#define EPS 1e-8
 
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((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
        if(d > ra + rb) cout << 0 << endl;
        else if(d < fabs(ra - rb)){
            if(ra > rb) cout << 2 << endl;
            else cout << -2 << endl;
        }
        else cout << 1 << endl;
    }
    return 0;
}