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 <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

#define vcitr vector<int>::iterator
#define vcsitr vector<string>::iterator
#define mapcitr map<char, int>::iterator
#define mapsitr map<string, int>::iterator

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }

struct Point2D { 
	double x, y;
	Point2D (double a=0, double b=0) { x=a; y=b; }
};

typedef Point2D Vector2D;

double dist2D(const Point2D& a, const Point2D& b) { return sqrt( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) ); }

Vector2D sub_vector2D(const Vector2D& a, const Vector2D& b) {
	Vector2D ret;
	ret.x = a.x - b.x; ret.y = a.y - b.y;
	return ret;
}

double cross_product(const Vector2D& a, const Vector2D& b) { return a.x*b.y - a.y*b.x; }

double inner_product(const Vector2D& a, const Vector2D& b) { return a.x*b.x + a.y*b.y; }

bool point_in_triangle_2D(const Point2D& a, const Point2D& b, const Point2D& c, const Point2D& p) {
	Vector2D ab = sub_vector2D(b, a); Vector2D bp = sub_vector2D(p, b);
	Vector2D bc = sub_vector2D(c, b); Vector2D cp = sub_vector2D(p, c);
	Vector2D ca = sub_vector2D(a, c); Vector2D ap = sub_vector2D(p, a);
	double c1 = cross_product(ab, bp), c2 = cross_product(bc, cp), c3 = cross_product(ca, ap);
	return ( (c1>0 && c2>0 && c3>0) || (c1<0 && c2<0 && c3<0) );
}

struct Circle {
	Point2D c; 
	double r;
	Circle (double a=0, double b=0, double rr=0) { c.x=a; c.y=b; r=rr; }
};

bool point_in_circle(const Point2D& p, const Circle& t) {
	double dist = dist2D(p, t.c);
	return (dist<t.r);
}

int circle_intersect(const Circle& a, const Circle& b) {
	double dist = dist2D(a.c, b.c);
	if (a.r + b.r < dist) return 0;
	if (dist + b.r < a.r) return 2;
	if (dist + a.r < b.r) return -2;
	return 1;
}

int main() {
	int n; cin >> n;
	Circle a, b;
	
	for_(i, 0, n) {
		cin >> a.c.x >> a.c.y >> a.r >> b.c.x >> b.c.y >> b.r;
		
		cout << circle_intersect(a, b) << endl;
	}
	
	return 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,double> 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<a.sc && d + EPS < a.sc-b.sc)return 1;       //no intersection (inside,B in A)
  if(a.sc<b.sc && d + EPS < b.sc-a.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 <<  0 << endl;
    else if(v==1)cout << 2 << endl;
    else if(v==2)cout << -2 << endl;
    else cout << 1 << endl;
  }
}

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

int main(){
	int n;
	cin >> n;
	while(n-->0){
		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(ra>d+rb) cout << 2 << endl;
		else if(rb>d+ra) cout << -2 << endl;
		else if(d>ra+rb) cout << 0 << endl;
		else cout << 1 << endl;
	}
}

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

int main(){
  int n,cnt=0;
  double xa,ya,ra,xb,yb,rb;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    if(xa+1*ra>=xb+1*rb) cnt++;
    if(ya+1*ra>=xb+1*rb) cnt++;
    if(xa+-1*ra<=xb+-1*rb) cnt++;
    if(xa+-1*ra<=xb+-1*rb) cnt++;


    if(xa+1*ra<xb-1*rb || ya+1*ra<yb-1*ra) cout<<0<<endl;
    else if(xa-1*ra>xb+1*rb || ya-1*ra>yb+1*ra) cout<<0<<endl;
    else if(cnt==4) cout<<2<<endl;
    else if(cnt==0) cout<<-2<<endl;
    else cout<<1<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

#define R(a,b) (a.r + b.r) * (a.r + b.r)
#define TP(a,b) (b.pos.x - a.pos.x) * (b.pos.x - a.pos.x) + (b.pos.y - a.pos.y) * (b.pos.y - a.pos.y)

using namespace std;

struct POINT{
	double x;
	double y;
};

struct CIRCLE{
	POINT pos;
	double r;
};

int main(){
	int n;
	cin >> n;

	CIRCLE a,b;
	while(n--){
		cin >> a.pos.x >> a.pos.y >> a.r >> b.pos.x >> b.pos.y >> b.r;

		if(R(a,b) >= TP(a,b)){
			POINT pa,pb,ma,mb;
			pa.x = a.pos.x + a.r;
			ma.x = a.pos.x - a.r;
			pa.y = a.pos.y + a.r;
			ma.y = a.pos.y - a.r;
			pb.x = b.pos.x + b.r;
			mb.x = b.pos.x - b.r;
			pb.y = b.pos.y + b.r;
			mb.y = b.pos.y - b.r;

			if(ma.x < mb.x && pa.x > pb.x){
				if(ma.y < mb.y && pa.y > pb.y) cout << "2" << endl;
			}
			else if(ma.x > mb.x && pa.x < pb.x){
				if(ma.y > mb.y && pa.y < pb.y) cout << "-2" << endl;
			}
			else{
				cout << "1" << endl;
			}
		}
		else if(R(a,b) < TP(a,b)){
			cout << "0" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>

using namespace std;

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

C++: #include <iostream>
#define eps 1e-10
using namespace std;
int main(){
	int n, a;
	cin >> n;
	while(n--){
		double x[2], y[2], r[2], d2;
		for(int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i];
		d2 = (x[1]-x[0])*(x[1]-x[0]) - (y[1]-y[0])*(y[1]-y[0]);	//??????????£?????????¢
		if(d2 > (r[0]+r[1])*(r[0]+r[1]) + eps) a = 0;			// d > ra+rb: ???????????????
		else if(d2 >= (r[0]-r[1])*(r[0]-r[1]) + eps) a = 1;	// ra+rb >= d >= ra-rb: ?????????
		else  r[0]>r[1] ? a = 2 : a = -2;							// ra-rb > d : ??????
		cout << a << endl;
	}
	return 0;
}