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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  cin>>n;
  while(n--){
    double x[2];
    double y[2];
    double r[2];
    rep(i,2)cin>>x[i]>>y[i]>>r[i];
    double d=hypot(x[1]-x[0],y[1]-y[0]);
    if(d>r[0]+r[1])cout<<0<<endl;
    else if(r[0]>r[1]&&r[0]-r[1]>d)cout<<2<<endl;
    else if(r[1]>r[0]&&r[1]-r[0]>d)cout<<-2<<endl;
    else cout<<1<<endl;
  }


}

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

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

int main(){
	P x,y;
	double r1,r2,dis;
	int n;
	cin>>n;
	while(n--){
		cin>>x.real()>>x.imag()>>r1>>y.real()>>y.imag()>>r2;
		dis=abs(x-y);
		if(dis>r1+r2){
			cout<<"0"<<endl;
		}else if(dis<r1){
			cout<<"2"<<endl;
		}else if(dis<r2){
			cout<<"-2"<<endl;
		}else{
			cout<<"1"<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>

int check_intersection(const double xa, const double ya, const double ra,
                       const double xb, const double yb, const double rb)
{
    double distance = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
    if(distance < (ra - rb) * (ra - rb)){
        if(ra > rb){
            return 2;
        }
        else{
            return -2;
        }
    }
    else if(distance > (ra + rb) * (ra + rb)){
        return 0;
    }
    else{
        return 1;
    }
}

int main ()
{
    double xa, ya, ra, xb, yb, rb;
    u_int N;
    
    std::cin >> N;
    for(u_int i = 0; i < N; ++i){
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        std::cout << check_intersection(xa, ya, ra, xb, yb, rb) << std::endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <cmath>
#include <set>
using namespace std;
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<n;i++)

class C{
public:
	double x;
	double y;
	double r;
};

double euc(C a,C b){
	a.x -= b.x;
	a.y -= b.y;
	return sqrt(a.x*a.x+a.y*a.y);
}

int main(){
	int n;
	C a,b;
	cin >> n;
	while(n--){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		if( euc(a,b)+b.r < a.r && a.r > b.r ){
			cout << 2 << endl;
		
		}else if( euc(a,b)+a.r < b.r && b.r > a.r ){
			cout << -2 << endl;
		}else if(euc(a,b) < b.r ){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
}

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

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


double xa, ya, ra, xb, yb, rb, d;
ll n;

int main(){
	cin >> n;
	REP(i, n){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (xa == xb&&ya == yb) d = 0;
		else if (xa == xb) d = abs(ya - yb);
		else if (ya == yb) d = abs(xa - xb);
		else d = sqrt(pow(xa - xb, 2) + (ya - yb, 2));
		if (d < abs(ra - rb)){
			if (ra > rb){
				cout << 2 << endl;
			}
			else{
				cout << -2 << endl;
			}
			continue;
		}
		if (d <= ra + rb){
			cout << 1 << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
}

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

struct Point2D {
    float x, y;

    Point2D() {}
    Point2D(float ax, float ay) {
        x = ax;
        y = ay;
    }
    Point2D operator -(const Point2D &p) const {
        return Point2D(x - p.x, y - p.y);
    }
    double distance(const Point2D &p) const {
        return sqrt(pow(x - p.x, 2) + pow(y - p.y, 2));
    }
    double slope(Point2D &p) {
        return (p.x != x) ? (p.y - y) / (p.x - x) : numeric_limits<float>::infinity();
    }
    double cross(Point2D &p) { // only z
        return x * p.y - y * p.x;
    }
};

istream &operator>>(istream &is, Point2D &p) {
    is >> p.x >> p.y;
    return is;
}

ostream &operator<<(ostream &os, Point2D &p) {
    os << fixed << p.x << " " << p.y;
    return os;
}

int circles_intersection(double distance, double ra, double rb)
{
    if (distance > ra + rb)
        return 0;
    else if (distance >= abs(ra - rb))
        return 1;
    else if (ra > rb)
        return 2;
    else
        return -2;
}

int main()
{
    Point2D pa, pb;
    double ra, rb;

    int n;
    cin >> n;

    for (;n-- && cin >> pa >> ra >> pb >> rb;)
        cout << circles_intersection(pa.distance(pb), ra, rb) << endl;

    return 0;
}

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

using namespace std;

struct point {
	double x, y;
}; 

struct circle {
	double r;
	point cen;
}cirA, cirB;

double dis(point A, point B) {
	return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}

//判断&#20004;&#22278;的位置&#20851;系
//&#36755;入&#20004;&#22278;的&#22278;心坐&#26631;及半径
//&#36755;出&#20004;&#22278;的位置&#20851;系 
int solve(circle cirA, circle cirB) {
	double disAB = dis(cirA.cen, cirB.cen);
	if (disAB > cirA.r + cirB.r) return 0; //相&#31163;
	if (disAB < max(cirA.r, cirB.r)) {
		if (disAB < cirA.r) return 2; //&#22278;B在&#22278;A内
		else return -2; //&#22278;A在&#22278;B内 
	} 
	return 0; //&#20004;&#22278;相交 
}

int main() {
	int t;
	scanf ("%d", &t);
	while (t--) {
		scanf ("%lf%lf%lf%lf%lf%lf", &cirA.cen.x, &cirA.cen.y, &cirA.r, &cirB.cen.x, &cirB.cen.y, &cirB.r);
		printf ("%d\n", solve(cirA, cirB));
	}
	return 0;
}