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 (1e-10)
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+d + EPS < a.sc)return 1;       //no intersection (inside,B in A)
  if(a.sc+d + EPS < b.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 <<  2 << endl;
    else if(v==2)cout << -2 << endl;
    else if(v==-1)cout << 0 << endl;
    else cout << 1 << endl;

  }
}

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

inline double squ_minus(double a, double b){
	double x = a - b;
	return x * x;
}

inline double squ_plus(double a, double b){
	double x = a + b;
	return x * x;
}

int main(){
	int n; // the number of datasets
	cin >> n;
	
	for(int i = 0; i < n; i++){
		std::array<double, 6> cir; // 0:xa, 1:ya, 2:ra, 3:xb, 4:yb, 5:rb
		cin >> cir[0] >> cir[1] >> cir[2] >> cir[3] >> cir[4] >> cir[5];

		double dis = squ_minus(cir[0], cir[3]) + squ_mins(cir[1], cir[4]);
		
		if(dis > squ_plus(cir[2], cir[5]){
			std::cout << "0" << std::endl;
		}else if(dis < squ_minus(cir[2], cir[5])){
			std::cout << (cir[2] > cir[5]) ? "2" : "-2" << std::endl;
		}else{
			std::cout << "1" << std::endl;
		}
	}
	return 0;
}

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

inline double distance(std::array<double, 2> pa,std::array<double, 2> pb){
	return sqrt( (pa[0] - pb[0])*(pa[0] - pb[0]) + (pa[1] - pb[1])*(pa[1] - pb[1]) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;
	std::vector<int> number;
	for(int i = 0; i < dataSetNum; ++i){
		std::array<double, 2> pa[i];
		std::array<double, 2> pb[i];
		double ra[i],rb[i];
		std::cin >> pa[i][0] >> pa[i][1] >> ra[i] >> pb[i][0] >> pb[i][1] >> rb[i];

		double dis = distance(pa[i],pb[i]);
		//if A and B do not overlap
		if(dis > ra[i] + rb[i]) number[i] = 0;
		//if B is in A
		else if(ra[i] > rb[i] && dis + rb[i] <= ra[i]) number[i] = 2;
		//if A is in B,
		else if(rb[i] > ra[i] && dis + ra[i] <= rb[i]) number[i] = -2;
		//if circumference of A and B intersect
		else number[i] = 1;
	}
	for(int i = 0; i < dataSetNum; ++i) std::cout << number[i] << std::endl;
	return 0;
	}

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

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

int main(){
	int n;
	double 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]) * 1000){
			cout << 0 << endl;
		}
		else if(dd + r[0] * 1000 <= r[1] * 1000){
			cout << -2 << endl;
		}
		else if (dd + r[1] * 1000 <= r[0] * 1000) {
			cout << 2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

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

struct Vector2D {
	double x;
	double y;
	double abs() const {
		return std::sqrt(x * x + y * y);
	}
	Vector2D& operator-=(const Vector2D& rhs) {
		x -= rhs.x;
		y -= rhs.y;
		return *this;
	}
};

Vector2D operator-(const Vector2D& lhs, const Vector2D& rhs)
{
	return Vector2D(lhs) -= rhs;
}

int main()
{
	int data_count = 0;
	std::cin >> data_count;
	for (int i = 0; i < data_count; ++i) {
		Vector2D a, b;
		double ra, rb;
		if (std::cin >> a.x >> a.y >> ra >> b.x >> b.y >> rb) {
			double rab = (b - a).abs();
			int result;
			if (ra > rab + rb) {
				result = 2;
			} else if (rb > rab + ra) {
				result = -2;
			} else if (ra + rb < rab) {
				result = 0;
			} else {
				result = 1;
			}
			std::cout << result << std::endl;
		}
	}

	return 0;
}

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

typedef pair<double,double>vec;

double norm(vec v1,vec v2){
    return sqrt((v1.first-v2.first)*(v1.first-v2.first)+(v1.second-v2.second)*(v1.second-v2.second));
}
int main()
{
    int n;
    cin>>n;
    while(n--){
        double x1,y1,r1,x2,y2,r2;
        cin>>x1>>y1>>r1>>x2>>y2>>r2;
        vec v1=make_pair(x1,y1);
        vec v2=make_pair(x2,y2);
        double dis=norm(v1,v2);
        if(dis>r1+r2)
            cout<<0<<endl;
        else if(dis>abs(r1-r2)&&dis<r1+r2){
            cout<<1<<endl;
        }
        else if(r1>r2){
            cout<<2<<endl;
        }
        else cout<<-2<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;

int main(){
	int num ;
	cin >> num;
	for(int j = 1;j<= num; j++){
	double x[2],y[2],r[2],r2[2];
	for(int i =0;i<=1;i++){
		cin >> x[i];
		cin >> y[i];
		cin >> r[i];
	}
	double d;
	d = sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
	if(r[0]+r[1]<d) cout << 0 << endl;
	else if(d >2* r[0]&& d > 2*r[1]) cout << 1 << endl;
	else if(r[0]<r[1]) cout << -2 << endl;
	else cout << 2 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int n;
double xa, ya, ra, xb, yb, rb;
bool doswap = false;

double dist(double x1, double x2, double y1, double y2) {
	double dx = xa - xb;
	double dy = ya - yb;
	return sqrt(dx*dx + dy*dy);
}

void swap(double *arg1, double *arg2) {
	double tmp = *arg1;
	*arg1 = *arg2;
	*arg2 = tmp;
}

int main() {
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		doswap = false;

		if (ra < rb) {
			swap(&xa, &xb);
			swap(&ya, &yb);
			swap(&ra, &rb);
			doswap = true;
		}

		double dist_ab = dist(xa, ya, xb, yb);

		if (dist_ab < ra) {
			if (dist_ab + rb < ra) {
				if (doswap) cout << "-2" << endl;
				else cout << "2" << endl;
			}
			else cout << "1" << endl;
		} else if (dist_ab <= ra + rb) cout << "1" << endl;
		else cout << "0" << endl;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/