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 <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair
typedef long long LL;
#define EPS (1e-6)
double zero(double d){
  return d < EPS ? 0.0 : d;
}

typedef pair<int,int> P;


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(7);
  int INF = 1000000;

  int N;
  while(cin>>N){
    double x1,y1,r1,x2,y2,r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

    double dis = sqrt( pow((x1-x2),2) + pow((y1-y2),2) );
    if( dis >= r1+r2 )
      cout << "0" << endl;
    else if( dis >= max(r1,r2) )
      cout << "1" << endl;
    else if( r1 >= r2+dis )
      cout << "2" << endl;
    else
      cout << "-2" << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n = 0;
	std::vector<int> a;
	double xa, ya, ra, xb, yb, rb;

#if INPUT_FROM_FILE
	//std::ifstream ifs("test.txt");
	FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	fscanf(fp, "%d", &n);
#else
	scanf("%d", &n);
#endif
	
	for(int i = 0; i < n; i++){
#if INPUT_FROM_FILE
		fscanf(fp, "%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
#else
		scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
#endif

		double d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));

		if(d > ra + rb){
			std::cout << 0 << std::endl;
		}
		else if(d + rb < ra){
			std::cout << 2 << std::endl;
		}
		else if(d + ra < rb){
			std::cout << -2 << std::endl;
		}
		else{
			std::cout << 1 << std::endl;
		}
	}
	return 0;
}

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>
#include <deque>

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

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) number.push_back(0);
		//"2" if B is in A
		else if(dis + rb <= ra) number.push_back(2);
		//"-2" if A is in B
		else if(dis + ra <= rb) number.push_back(-2);
		//"1" if circumference of A and B intersect
		else number.push_back(1);
	}
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	return 0;
	}

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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya -yb);
		float d = abs(comp);
		float r = ra + rb;
		if(d <= r){
			if(d < ra && rb < ra){
				cout << 2 << endl;
			}
			else if(d < rb && ra < rb){
				cout << -2 << endl;
			}
			else{
				cout << 1 << endl;
			}
		}
		if(d > r){
			cout << 0 << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

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

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

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

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

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

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

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) number.push_back( 0 );
		//"2" if B is in A
		else if(ra > rb && dis + rb <= ra) number.push_back( 2 );
		//"-2" if A is in B,
		else if(rb > ra && dis + ra <= rb) number.push_back( -2 );
		//"1" if circumference of A and B intersect
		else number.push_back( 1 );
	}
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	return 0;
	}

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

using namespace std;

int Calculate(double, double, double, double, double, double);
double GetDistance(double, double, double, double);

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

  cin >> n;
  for(i=0; i<n; ++i){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    cout << Calculate(xa, ya, ra, xb, yb, rb) << endl;
  }
  return 0;
}

int Calculate(double xa, double ya, double ra,
	      double xb, double yb, double rb){
  double r;
  r = GetDistance(xa, ya, xb, yb);
  if(ra > rb && ra > r + rb) return 2;
  if(ra < rb && rb > r + ra) return -2;
  if(r <= ra + rb) return 1;
  return 0;
}

double GetDistance(double xa, double ya, double xb, double yb){
  double x, y;
  x = xa - xb;
  y = ya - yb;
  return sqrt(x*x + y*y);
}

C++: #include <iostream>
#include <math.h>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(r1+r2 <= u){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}