Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var xa, ya, ra, xb, yb, rb float64
		fmt.Scan(&xa, &ya, &ra, &xb, &yb, &rb)
		// println(xa, ya, ra, xb, yb, rb)
		dis := math.Sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
		if dis + ra < rb {
			fmt.Println(-2)
		} else if dis + rb < ra {
			fmt.Println(2)
		} else if dis > rb + ra {
			fmt.Println(0)
		} else {
			fmt.Println(1)
		}
	}
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define HOGE 5000
#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define sz size()


int main(){
    int n;
    cin>>n;
    rep(i,n){
        double x[2],y[2],r[2];
        rep(j,2){
            cin>>x[j]>>y[j]>>r[j];

        }
        double len=sqrt( pow(abs(x[0]-x[1]),2) + pow(abs(y[0]-y[1]),2) );

        if( r[0]+r[1]<len ){
            cout<<"0"<<endl;
        }
        else{
            if(len+r[0]<r[1])cout<<"-2"<<endl;
            else if(len+r[1]<r[0])cout<<"2"<<endl;
            else cout<<"1"<<endl;
            }
        }
    return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
struct en{
	pair<double, double> pos;
	double r;
};
int main() {
	int n;
	cin >> n;
	while (n--){
		en e1,e2;
		cin >> e1.pos.first >> e1.pos.second >> e1.r >> e2.pos.first >> e2.pos.second >> e2.r;
		double dis = hypot(e1.pos.first - e2.pos.first, e1.pos.second - e2.pos.second);
		if (e1.r>e2.r&&dis*2<e1.r)cout<<2<<endl;
		else if (e1.r<e2.r&&dis * 2<e2.r)cout << -2 << endl;
		else if (e1.r + e2.r>dis)cout << 1 << endl;
		else cout << 0 << endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <cmath>
 
int state_circles(const std::vector<double> &a, const std::vector<double> &b){
    double d;
    d = sqrt(pow(a[0] - b[0], 2) + pow(a[1] - b[1], 2));
    if((a[2] + b[2]) < d)
        return 0;
        if(std::abs(a[2] - b[2]) > d){
        if(a[2] > b[2])
            return 2;
        else
            return -2;
    }
     
    else
        return 1;
}
 
int main(){
    std::vector<double> a(3), b(3);
    int data_num;
    std::cin >> data_num;
    for(int i = 0; i < data_num; ++i){ 
        std::cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];
        std::cout << state_circles(a, b) << std::endl;
    }
     
    return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		double xa, ya, ra;
		double xb, yb, rb;
		cin >> xa >> ya >> ra
			>>xb >> yb >> rb;
		double dis = (xb - xa) * (xb - xa) + (yb - ya) * (yb - ya);
		if((ra * ra) >= (dis + rb)){
			cout << 2 << endl;
		}else if((rb * rb) >= (dis + ra)){
			cout << -2 << endl;
		}else if((ra + rb) >= dis){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
	return 0;
}

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

int main(){
  double x1,y1,r1,x2,y2,r2,ans;
  int n;
  cin >> n;
  while(cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2){
    double len = sqrt(pow(x1-x2,2) + pow(y1-y2,2));
    if( len + r2 <= r1){
      ans = 2;
    } else if(len + r1 <= r2){
      ans = -2;
    } else if(len <= r1 + r2){
      ans = 1;
    } else {
      ans = 0;
    }
    cout << ans << endl;
  }
}

C++: //#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>

using namespace std;


int main(){

	int n, ans;
	double xa, ya, ra, xb, yb, rb;
	double R;

	cin >> n;

	while (n--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		R = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));

		if (R > ra + rb){
			ans = 0;
		}
		else{
			ans = 1;
			if (ra > R + rb)ans = 2;
			if (rb > R + ra)ans = -2;
		}

		cout << ans << endl;

	}

	return 0;
}

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

double eps = 1e-10;

class Point {
public:
	double x, y;
	
	Point(double x = 0, double y = 0) : x(x), y(y) {}
	
	Point operator + (const Point& p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (const Point& p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (const double& a) {
		return Point(x * a, y * a);
	}
	Point operator / (const double& a) {
		return Point(x / a, y / a);
	}
	
	bool operator < (const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator == (const Point& p) const {
		return fabs(x - p.x) < eps && fabs(y - p.y) < eps;
	}
	
	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	
};

class Circle {
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) : c(c), r(r) {}
};

int main() {
	int n;
	cin >> n;
	double x1, y1, r1, x2, y2, r2;
	for(int i = 0; i < n; ++i){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		Circle c1 = Circle(Point(x1, y1), r1);
		Circle c2 = Circle(Point(x2, y2), r2);
		double minr = max(c1.r, c2.r);
		double maxr = max(c1.r, c2.r);
		
		if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) + pow(minr / 2.0, 2.0) < pow(maxr, 2.0)){
			if(c1.r > c2.r)
				cout << "2" << endl;
			else
				cout << "-2" << endl;
		}
		else if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) <= pow(c1.r + c2.r, 2.0)){
			cout << "1" << endl;
		}
		else{
			cout << "0" << endl;
		}
	}
	return 0;
}

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
	std::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
		std::cin >> cir[0] >> cir[1] >> cir[2] >> cir[3] >> cir[4] >> cir[5];

		double dis = squ_minus(cir[0], cir[3]) + squ_minus(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;
}