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 <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;

int main(void){
	double x1,x2,y1,y2,r1,r2;
	int n;
	cin >> n;
	rep(i,0,n){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2 ;
		x1 = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
		
		if(r1 > x1 + r2){
			cout << 2;
		}
		else if(r2 > x1 + r1){
			cout << -2;
		}
		else if(r1 + r2 < x1){
			cout << 0;
		}
		else{
			cout << 1;
		}
		cout << "\n";
	}
	return 0;
}

C++: #include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) container.begin(), container.end()
#define RALL(container) container.rbegin(), container.rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;

namespace geom{
#define X real()
#define Y imag()
	
	typedef double R;
	typedef complex<R> P;
	istream& operator>>(istream &is, P &p) {
		double x, y;
		is >> x >> y;
		p = P(x, y);
		return is;
	}
	struct L : public vector<P>{
		L(const P &p1, const P &p2){this->push_back(p1);this->push_back(p2);}
		friend istream& operator>>(istream &is, L &l) {
			P p1, p2;
			is >> p1 >> p2;
			l = L(p1, p2);
			return is;
		}
	};
	inline int sig(double x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }
	inline R norm(const P &p){return p.X*p.X+p.Y*p.Y;}
	inline R inp(const P& a, const P& b){return (conj(a)*b).X;}
	inline R outp(const P& a, const P& b){return (conj(a)*b).Y;}
	inline P unit(const P& p){return p/abs(p);}
	inline P proj(const P &s, const P &t){return t*inp(s, t)/norm(t);}
	inline P proj(const P &s, const L &t){return t[0] + proj(s-t[0], t[1]-t[0]);}
	inline bool sp_intersect(const L &s, const P &p){return !sig(abs(s[0]-p) + abs(s[1] - p) - abs(s[0] - s[1]));}
	
	struct C : public P{
		double r;
		friend istream& operator>>(istream &is, C &c) {
			operator>>(is, (P &)c);
			is >> c.r;
			return is;
		}
	};
	
	struct G : public vector<P>{
		enum {OUT, IN, ON};
		P &at(int i){return (*this)[i];}
		bool contains(const P &p){
			R sum = .0;
			REP(i, size()){
				if(sp_intersect(L(at(i), at((i+1)%size())), p)) return ON;	// online
				sum += arg((at(i) - p) / (at((i+1)%size()) - p));
			}
			return sig(sum) ? IN : OUT;
		}
		
		R area(){
			R sum = 0;
			REP(i, size()) sum += outp(at(i), at((i+1)%size()));
			return abs(sum / 2.);
		}
	};
};
using namespace geom;

int n;

int main(){
	ios::sync_with_stdio(false);
	int T;
	cin >> T;
	REP(t, T){
		C a, b;
		cin >> a >> b;
		int ans;
		if(abs(a-b) > a.r + b.r) ans = 0;
		else if(abs(a-b)+b.r < a.r) ans = 2;
		else if(abs(a-b)+a.r < b.r) ans = -2;
		else ans = 1;
		cout << ans << endl;
	}
	return 0;
}

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

int solver(double ra, double rb, double d);

int main(void)
{
    double xa,ya,ra,xb,yb,rb,d;
    int n;
    
    cin >> n;
    
    rep(i,n)
    {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        d = hypot(xb-xa, yb-ya);
        cout << solver(ra, rb, d) << endl;
    }
    
    return 0;
}

int solver(double ra, double rb, double d)
{
    if(d+rb<ra)
        return 2;
    else if(d+ra<rb)
        return -2;
    else if(ra+rb<d)
        return 0;
    else
        return 1;
}

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

class Point{
public:
    double x,y;
    
    Point(double xx,double yy){
        x = xx;
        y = yy;
    }
};

double distance(Point p1,Point p2){
    return sqrt(pow(p1.x-p2.x,2)+pow(p1.y-p2.y,2));
}

int main(){
    int n;
    
    struct data1{
        double x,y,r;
    } circle1;
    
    struct data2{
        double x,y,r;
    } circle2;
    
    cin >> n;
    while(n--){
        cin >> circle1.x >> circle1.y >> circle1.r;
        cin >> circle2.x >> circle2.y >> circle2.r;
        
        Point p1(circle1.x,circle1.y),p2(circle2.x,circle2.y);
        double d = distance(p1,p2);
        
        if(circle1.r + circle2.r < d) cout << "0" << endl;
        else if(circle2.r + d < circle1.r) cout << "2" << endl;
        else if(circle1.r + d < circle2.r) cout << "-2" << endl;
        else cout << "1" << 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 (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;
}