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 <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rep3(var, min, max) for (ll (var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll (var) = (max) - 1; (var) + 1 > (min); --(var))
#define Mp(a,b) make_pair((a),(b))
#define F first
#define S second
#define Icin(s) ll (s);cin>>(s);
#define Scin(s) ll (s);cin>>(s);
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 (b<a) { a=b; return 1; } return 0; }
const double EPS=1e-10;
double add(double l, double r){
    if(abs(l+r)<EPS*(abs(l)+abs(r))) return 0;
    return l+r;
}
//l-r は add(l,-r)
//l==r は add(l,-r)==0
struct Pt{
    double x, y;
    Pt(double xx=0, double yy=0){x=xx; y=yy;}
    Pt& operator=(const Pt &rhs){
        x=rhs.x; y=rhs.y; return *this;
    }
    Pt& operator+=(const Pt &rhs){
        x = add(x,rhs.x); y = add(y,rhs.y); return *this;
    }
    Pt& operator-=(const Pt &rhs){
        x = add(x,-rhs.x); y = add(y,-rhs.y); return *this;
    }
    Pt& operator*=(const double &rhs){
        x *= rhs; y *= rhs; return *this;
    }
    Pt& operator/=(const double &rhs){
        x /= rhs; y /= rhs; return *this;
    }
};
Pt operator+(const Pt &a){return a;}
Pt operator-(const Pt &a){return Pt(-a.x,-a.y);}
Pt operator+(const Pt &lhs, const Pt &rhs){
    Pt ans=lhs; ans += rhs; return ans;
}
Pt operator-(const Pt &lhs, const Pt &rhs){
    Pt ans=lhs; ans -= rhs; return ans;
}
Pt operator*(const Pt &lhs, const double &rhs){
    Pt ans=lhs; ans *= rhs; return ans;
}
Pt operator*(const double &lhs, const Pt &rhs){
    Pt ans=rhs; ans *= lhs; return ans;
}
Pt operator/(const Pt &lhs, const double &rhs){
    Pt ans=lhs; ans /= rhs; return ans;
}
bool operator==(const Pt &lhs, const Pt &rhs){
    return add(lhs.x,-rhs.x)==0 && add(lhs.y,-rhs.y)==0;
}
bool operator!=(const Pt &lhs, const Pt &rhs){return !(lhs==rhs);}
bool operator<(const Pt &lhs, const Pt &rhs){
    return add(lhs.x,-rhs.x)!=0 ? lhs.x<rhs.x : add(lhs.y,-rhs.y)<0;
}
bool operator>(const Pt &lhs, const Pt &rhs){return rhs<lhs;}
bool operator<=(const Pt &lhs, const Pt &rhs){return !(lhs>rhs);}
bool operator>=(const Pt &lhs, const Pt &rhs){return !(lhs<rhs);}
istream& operator>>(istream &is, Pt &rhs){
    double x, y;
    is >> x >> y;
    rhs=Pt(x,y);
    return is;
}
ostream& operator<<(ostream &os, const Pt &rhs){
    os << rhs.x << " " << rhs.y;
    return os;
}
double norm(const Pt &a){return add(a.x*a.x,a.y*a.y);}
double abs(const Pt &a){return sqrt(norm(a));}
double dot(Pt a, Pt b){return add(a.x*b.x,a.y*b.y);}
double cross(Pt a, Pt b){return add(a.x*b.y,-a.y*b.x);}
int ccw(Pt a, Pt b, Pt c) {
    b -= a; c -= a;
    if(cross(b, c)>0) return +2;  // counter clockwise
    if(cross(b, c)<0) return -2;  // clockwise
    if(dot(b, c)<0) return +1;        // c--a--b on line
    if(norm(c)<norm(b)) return -1;    // b--c--a on line
    return 0;                         // a--b--c on line
}
bool judge_cross(ld ax,ld ay,ld bx,ld by,ld cx,ld cy,ld dx,ld dy){
    ld ta = (cx - dx) * (ay - cy) + (cy - dy) * (cx - ax);
    ld tb = (cx - dx) * (by - cy) + (cy - dy) * (cx - bx);
    ld tc = (ax - bx) * (cy - ay) + (ay - by) * (ax - cx);
    ld td = (ax - bx) * (dy - ay) + (ay - by) * (ax - dx);

  return tc * td < 0 && ta * tb < 0;
}
int main(){
    int n;cin>>n;
    rep(i,n){
        ld xa,ya,ra,xb,yb,rb;
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        if(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))>ra+rb){
            cout<<0<<endl;
        }else if(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))<ra-rb){
            cout<<2<<endl;
        }else if(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))<rb-ra){
            cout<<-2<<endl;
        }else{
            cout<<1<<endl;
        }
    }
}

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

using namespace std;
int main(){
	int N;
	cin >> N;
	for(int i = 0;i < N;i++){
		double xa, ya, ra;
		double xb, yb, rb;
		double d, R;

		cin >> xa >> ya >> ra;
		cin >> xb >> yb >> rb;

		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		R = fabs(ra-rb);
		if(ra+rb < d){
			cout << "0" << endl;
		}
		else if(ra+rb == d || (R < d && d < ra+rb) || R == d){
			cout << "1" << endl;
		}
		else if(R > d && ra > rb){
			cout << "2" << endl;
		}
		else if(R > d && ra < rb){
			cout << "-2" << endl;
		}

	}

	
	return 0;
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

struct Circle
{
	double x, y;
	double r;
};

int hit(Circle c0, Circle c1)
{
	double x = (c1.x - c0.x);
	double y = (c1.y - c0.y);

	double d = sqrt(x * x + y * y);
	if (d <= c0.r + c1.r)
	{
		if (c0.r >= d || c1.y >= d)
		{
			return 2;
		}
		else
		{
			return -2;
		}
	}
	else
	{
		return 0;
	}
}

int main()
{
	int n;
	for (cin >> n; n--;)
	{
		Circle c0, c1;
		cin >> c0.x >> c0.y >> c0.r;
		cin >> c1.x >> c1.y >> c1.r;

		cout << hit(c0, c1) << endl;
	}
}

C++: /*AOJ 0023*/

#include<iostream>
#include<vector>

using namespace std;

class Circle_obj{
public:
	double x,y,r;
};

int isCircleToCircle(Circle_obj a,Circle_obj b){

	double tmpX = a.x - b.x;
	double tmpY = a.y - b.y;

	double R = tmpX*tmpX + tmpY*tmpY;

	if(a.r >= b.r){
		if( R <= a.r*a.r){
			return 2;
		}
	}
	else{
		if( R <= b.r*b.r){
			return -2;
		}
	}

	if( R <= a.r*a.r + b.r * b.r){
		return 1;
	}
	else{
		return 0;
	}
}

int main(){

	int n;

	cin>>n;

	Circle_obj a,b;

	vector<int> data;

	for(int i=0;i<n;i++){
		cin>>a.x;
		cin>>a.y;
		cin>>a.r;
		cin>>b.x;
		cin>>b.y;
		cin>>b.r;

		cout<<isCircleToCircle(a,b)<<endl;
	}
	/*
	for(int i=0;i<n;i++){
		cout<<data.at(i)<<endl;
	}
	*/

	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int N;
struct C{
	double x,y,r;
};
main()
{
	cin>>N;
	for(;N--;)
	{
		C a,b;
		cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
		double d=hypot(a.x-b.x,a.y-b.y);
		cout<<(d>a.r+b.r?0:d<a.r-b.r?2:d<b.r-a.r?-2:1)<<endl;
	}
}