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

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

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

C++: #include<cstdio>
#include<cmath>
using namespace std;
static inline double s(double a){ return a * a; }
int main() {
	int n;
	scanf("%d",&n);
	while(n--) {
		double xa,ya,ra,xb,yb,rb;
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		double d = sqrt(s(xb-xa) + s(yb-ya));
		if(d + ra < rb) puts("-2");
		else if(d + rb < ra) puts("2");
		else if(d > ra + rb) puts("0");
		else puts("1");
	}
	return 0;
}

C++: #include<iostream>
#include<complex>
#include<cmath>
#include<map>
#define fs first
#define sc second
#define EPS 0
using namespace std;


typedef complex<double> P;
typedef pair<P,int> 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 && b.sc+d + EPS < a.sc)return 1;       //no intersection (inside,B in A)
  if(a.sc<b.sc && a.sc+d + EPS < b.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 <<  2 << endl;
    else if(v==2)cout << -2 << endl;
    else if(v==-1)cout << 0 << endl;
    else cout << 1 << endl;

  }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
double EPS=1e-10;
double add(double a, double b)
{
	if(abs(a+b)<EPS*(abs(a)+abs(b)) ) return 0;
	else return a+b;
}
int main()
{
	int n ; cin >> n ;
	while(n--)
	{
		double x[2],y[2],r[2];
		for(int i=0;i<2;i++) cin >> x[i] >> y[i] >> r[i] ;
		double dist2=add( (x[1]-x[0])*(x[1]-x[0]),(y[1]-y[0])*(y[1]-y[0]) );
		int ans=0;
		if(dist2<r[0]*r[0]) ans=2;
		else if(dist2<r[1]*r[1]) ans=-2;
		else if(dist2<=add(r[0],r[1])*add(r[0],r[1])) ans=1;
		else if(!add( add(r[0],r[1])*add(r[0],r[1]),-dist2) ) ans=1;
		cout << ans << '\n' ;
	}
}

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

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

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

double calcDistance(double x1, double y1, double x2, double y2){
	double d;
	d = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
	return d;
}

int main(){
	double xa, ya, ra;
	double xb, yb, rb;
	int num;
	std::cin >> num;
	
	while(num){
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = calcDistance(xa, ya, xb, yb);
		int answer = 1;
		
		if(ra + rb < d) 
			answer = 0;
		else if(ra - rb > d)
			answer = 2;
		else if(rb - ra > d)
			answer = -2;
			
		std::cout << answer << std::endl;
		--num;
	}


}

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

using namespace std;


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

circle c[2];


bool isIn(circle a, circle b){
  return (b.x+b.r < a.x+a.r && b.y+b.r < a.y+a.r);
}

bool cross(circle a, circle b){
  double diff = sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));
  return diff < a.r+b.r;
}
int solve(){

  if(isIn(c[0],c[1])) return 2;
  else if(isIn(c[0],c[1]))return -2;
  else if(cross(c[0],c[1])) return 1;
  else return 0;
}

int main(){

  int n;
  cin >> n;
  while(n--){
    for(int i = 0; i < 2; i++)
      cin >> c[i].x >> c[i].y >> c[i].r;

    cout << solve() << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

double dist(double x1,double y1,double x2,double y2){
	return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}
int main(){
	int n;
	cin>>n;
	rep(i,0,n){
		double xa,ya,ra,xb,yb,rb,d;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		d=dist(xa,ya,xb,yb);
		if(ra>d+rb) o(2);
		else if(rb>d+ra) o(-2);
		else if(d>ra+rb) o(0);
		else o(1);
	}
}

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-2;

#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 d = distPP(c1,c2);
  if(d >r1+r2) return 0;
  else if(r1 >= d+r2) return 2;
  else if(r2 >= d+r1) 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 <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){
			if (ra > rb){
				cout << 2 << endl;
			}
			else{
				cout << -2 << endl;
			}
			continue;
		}		
		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;
		}
	}
}