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++: // AOJ 0023
#include<iostream>
#include<cmath>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const long double EPS = 1e-7;

long double sq(long double x) {
  return x * x;
}

long double abs(long double x) {
  return (x > 0 ? x : -x);
}
/*
bool eq(long double x, long double y) {
  return abs(x - y) < EPS;
}*/

long double dist(long double xa, long double ya, long double xb, long double yb) {
  return sq(xa - xb) + sq(ya - yb);
}

int main() {
  int n;
  cin >> n;
  REP(i, n) {
    long double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    long double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
    
    if (ra - rb > d + EPS) {
      cout << 2 << endl;
    } else if (rb - ra > d + EPS) {
      cout << -2 << endl;
    } else if (d > ra + rb + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

C++: #include <iostream>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      double d = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
      if(d  > (ra+rb)*(ra+rb))
	ans = 0;
      else if (d <=  (ra-rb)*(ra-rb))
	ans = 2;
      else if (d  <= (rb-ra)*(rb-ra))
	ans =-2;
      else
	ans =-1;

      cout<<ans<<endl;

    }

}

C++: //接する場合が未定義なのだが…
#include<iostream>
using namespace std;

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

C++: #include <cstdio>
#include <complex>
#include <vector>
#include <cmath>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-3;

#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)
#define LE(x,y) (x < y + EPF)
#define GE(x,y) (x + EPF > y)

double dot(P a, P b) {
  return (conj(a)*b).X;
}
double cross(P a, P b) {
  return (conj(a)*b).Y;
}
int isparallel(P a, P b, P c, P d) {//ab,cd
  return EQ(cross(a-b, c-d),0);
}
double distPP(P a, P b) {
  return sqrt(dot(a-b,a-b));
}
int relationCC(P c1, double r1, P c2, double r2) {//0..not overlap, 1..intersect, 2..2isin1, -2..1isin2
  double d2 = dot(c1-c2,c1-c2);
  double prr = (r1+r2)*(r1+r2);
  double mrr = (r1-r2)*(r1-r2);
  if(GE(d2 ,prr)) return 0;
  else if(GE(mrr, d2)) {
    if(r1 > r2) return 2;
    else return -2;
  }
  else return 1;
}
P intersection(P a, P b, P c, P d) {//ac , bd
  double d1 = cross(d-b,b-a);
  double d2 = cross(d-b,c-a);
  if(EQ(d1,0) & EQ(d2,0)) return a;
  if(EQ(d2,0)) return a;
  return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
  P b(-a.Y, a.X);
  return b;
}
P polar(double r, double theta) {
  P a(r*cos(theta),r*sin(theta));
  return a;
}


int main() {
  int n;
  scanf("%d",&n);
  REP(i,n) {
    double x,y,r1,r2;
    scanf("%lf %lf %lf", &x, &y, &r1);
    P a(x,y);
    scanf("%lf %lf %lf", &x, &y, &r2);
    P b(x,y);
    printf("%d\n", relationCC(a,r1,b,r2));
  }
  return 0;
}

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

using db = double;
const db eps = 1e-12;
int sgn(db a, db b = 0) {
	a -= b;
	return (a > eps) - (a < -eps);
}

struct poi {
	db x, y;
	void r() { cin >> x >> y; }
	poi operator -(poi p) {
		return {x - p.x, y - p.y};
	}
	db len() {
		return sqrt(x * x + y * y);
	}
};

int main() {
	ios :: sync_with_stdio(false);
	int t; cin >> t;
	while(t --) {
		poi a, b; db ra, rb;
		a.r(); cin >> ra;
		b.r(); cin >> rb;
		db d = (b - a).len();
		if(sgn(d, ra + rb) <= 0 &&
			sgn(d, abs(ra - rb)) >= 0)
			cout << "1\n";
		else if(sgn(ra + d, rb) < 0)
			cout << "-2\n";
		else if(sgn(rb + d, ra) < 0)
			cout << "2\n";
		else
			cout << "0\n";
	}
	return 0;
}

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

double distance(double x1, double y1, double x2, double y2){
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}

int main() {
    int n;
    double xa, ya, ra, xb, yb, rb;
    std::cin >> n;
    
    while(n--){
        std::cin >> xa >> xb >> ra >> xb >> yb >> rb;
        double dis = distance(xa, ya, xb, yb);;
        if(dis + rb < ra)
            std::cout << "2" << std::endl;
        else if(dis + ra < rb)
            std::cout << "-2" << std::endl;
        else if(dis == ra + rb)
            std::cout << "1" << std::endl;
        else
            std::cout << "0" << std::endl;
    }
    return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const double INF = 1e12;


int main(){
	int n;
	cin>>n;
	double xa,ya,ra,xb,yb,rb;
	REP(i,n){
		
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double d2=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
		if(ra>rb&&d2<(ra-rb)*(ra-rb)+EPS){
			cout<<"2"<<endl;
		}else if(ra<rb&&d2<(ra-rb)*(ra-rb)+EPS){
			cout<<"-2"<<endl;
		}else if(d2<(ra+rb)*(ra+rb)+EPS){
			cout<<"1"<<endl;
		}else{
			cout<<"0"<<endl;
		}
	}
	return 0;
}
/*
2
0.0 0.0 5.0 0.0 0.0 4.0
0.0 0.0 3.0 4.1 0.0 2.0
*/