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

int main(void){
	int n;
	cin >> n;
	for(int i=0;i<n;++i){
		double xa,ya,ra,xb,yb,rb,ab;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d_2 = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
		if(d_2>(ra+rb)*(ra+rb)){
			cout << "0\n";
		}else if(d_2==(ra+rb)*(ra+rb)){
			cout << "1\n";
		}else{
			if(d_2<(ra-rb)*(ra-rb)&&(ra>rb)){
				cout << "2\n";
			}else if(d_2<(rb-ra)*(rb-ra)&&(ra<rb)){
				cout << "-2\n";
			}else{
				cout << "1\n";
			}
		}
	}
	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;
}

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

int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		complex<double> a,b;
		double ra,rb;
		cin>>a.real()>>a.imag()>>ra>>b.real()>>b.imag()>>rb;

		if(ra>rb&&abs(a-b)<(ra-rb)) cout<<2<<endl;
		else if(ra<rb&&abs(a-b)<(rb-ra)) cout<<-2<<endl;
		else if(abs(a-b)>(ra+rb)) cout<<0<<endl;
		else cout<<1<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  int n; scanf("%d",&n);
  while(n --> 0){
    P c1, c2; double r1, r2;
    scanf("%lf%lf%lf%lf%lf%lf",&c1.real(),&c1.imag(),&r1,&c2.real(),&c2.imag(),&r2);
    double dist = abs(c1 - c2);
    if(r1 > dist + r2) puts("2");
    else if(r2 > dist + r1) puts("-2");
    else if(r1 + r2 + EPS >= dist) puts("1");
    else puts("0");
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

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

int hit(Circle c0, Circle c1)
{
	double x = (c1.x - c0.x);
	double y = (c1.y - c0.y);

	double d = sqrt(x * x + y * y);
	if (d <= c0.r + c1.r)
	{
		if (c0.r + d < c1.r)
		{
			return -2;
		}
		else if (c1.r + d < c0.r)
		{
			return 2;
		}
		else
		{
			return 1;
		}
	}
	else
	{
		return 0;
	}
}

int main()
{
	int n;
	for (cin >> n; n--;)
	{
		Circle c0, c1;
		cin >> c0.x >> c0.y >> c0.r;
		cin >> c1.x >> c1.y >> c1.r;

		cout << hit(c0, c1) << endl;
	}
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int main()
{
	int n;
	scanf("%d", &n);
	rep(i, n){
		double xa, ya, ra, xb, yb, rb;
		scanf("%lf%lf%lf%lf%lf%lf", &xa, &ya, &ra, &xb, &yb, &rb);

		double dist = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		if(dist > ra+rb)
			puts("0");
		else if(dist+ra < rb)
			puts("-2");
		else if(dist+rb < ra)
			puts("2");
		else
			puts("1");
	}

	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, dist;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		dist = std::sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (dist + rb < ra) std::cout << 2 << std::endl;
		else if (dist + ra < rb) std::cout << -2 << std::endl;
		else if (dist <= ra + rb) std::cout << 1 << std::endl;
		else std::cout << 0 << std::endl;
	}
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya -yb);
		float d = abs(comp);
		float r = ra + rb;
		if(d <= r){
			if(d < ra && rb < ra){
				cout << "2" << endl;
			}
			else if(d < rb && ra < rb){
				cout << "-2" << endl;
			}
			else{
				cout << "1" << endl;
			}
		}
		if(d > r){
			cout << "0" << endl;
		}
	}
	return 0;
}