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

C++: #include<iostream>
#include<math.h>
using namespace std;

int checker(int i,double* x1,double* y1,double* r1,double* x2,double*y2,double* r2){
  double x=x1[i]-x2[i];
  double y=y1[i]-y2[i];
  if(r1[i]>r2[i]){
    if(sqrt(x*x+y*y)<r1[i]-r2[i])return 2;
    else if(sqrt(x*x+y*y)>=r1[i]-r2[i]&&sqrt(x*x+y*y)<=r1[i]+r2[i])return 1;
    else if(sqrt(x*x+y*y)>r1[i]+r2[i])return 0;
  }
  else {
    if(sqrt(x*x+y*y)<r2[i]-r1[i])return -2;
    else if(sqrt(x*x+y*y)>=r2[i]-r1[i]&&sqrt(x*x+y*y)<=r1[i]+r2[i])return 1;
    else if(sqrt(x*x+y*y)>r1[i]+r2[i])return 0;
  }
}
int main(){
  int x;
  cin>>x;
  int answers[x];double x1[x],y1[x],r1[x],x2[x],y2[x],r2[x];
  for(int i=0;i<x;i++){
    cin>>x1[i]>>y1[i]>>r1[i]>>x2[i]>>y2[i]>>r2[i];
    answers[i]=checker(i,x1,y1,r1,x2,y2,r2);
  }
  for(int i=0;i<x;i++){
    cout<<answers[i]<<endl;
  }
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

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

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );

    if(dist>ra+rb)
      cout<<"0"<<endl;
    else if(ra<dist)
      cout<<"1"<<endl;
    else if(rb<ra)
      cout<<"2"<<endl;
    else if(ra<rb)
      cout<<"-2"<<endl;
  }
}

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

int main(){
	
	int data;
	
	std::cin >> data;  //dataset
	
	std::array<double, data>xa;
	std::array<double, data>ya;
	std::array<double, data>ra;
	std::array<double, data>xb;
	std::array<double, data>yb;
	std::array<double, data>rb;
	
	for(int i=0; i<data; ++i){
		std::cin >> xa[i];
		std::cin >> ya[i];
		std::cin >> ra[i];
		std::cin >> xb[i];
		std::cin >> yb[i];
		std::cin >> rb[i];
	}
	
	double length;  //a-b length;
	
	length = hypot(abs(xa-xb),abs(ya-yb));
	
	if(length > ra+rb){
		std::cout << 0 << std::endl;
	}else if(length + rb < ra){
		std::cout << 2 << std::endl; 
	}else if(length + ra < rb){
		std::cout << -2 << std::endl; 
	}else{
		std::cout << 1 << std::endl; 
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int n;
double x_1, y_1, r_1, x_2, y_2, r_2;

int main() {
	scanf( "%d", &n );
	for ( int i = 0; i < n; i++ ) {
		scanf( "%lf %lf %lf %lf %lf %lf", &x_1, &y_1, &r_1, &x_2, &y_2, &r_2 );
		int ans = 0;
		double _range = sqrt( sq( x_1 - x_2 ) + sq( y_1 - y_2 ) );
		if ( _range <= r_1 + r_2 ) {
			ans = 1;
			if ( _range + r_1 <= r_2 ) {
				ans = -2;
			}
			else if ( _range + r_2 <= r_1 ) {
				ans = 2;
			}
		}
		printf( "%d\n", ans );
	}
	return 0;
}

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

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

  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> xa >> ya >> ra >> xb >> yb;
    double d = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));

    int ans;
    if(d+ra < rb) ans = -2;
    else if(d+rb < ra) ans = 2;
    else if(d > ra+rb) ans = 0;
    else ans = 1;

    cout << ans << endl;
  }
}

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

const long double EPS = 1e-6;

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 = dist(xa, ya, xb, yb);
//    cout << d << endl;
    
    if (sq(ra - rb) > d + EPS and ra > rb + EPS) {
      cout << 2 << endl;
    } else if (sq(rb - ra) > d + EPS and rb > ra + EPS) {
      cout << -2 << endl;
    } else if (d > sq(ra + rb) + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main() {
	int n,c;
	double xa,ya,ra,xb,yb,rb,l;
	cin >> n;
	for (n;n>0;n--) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
        l=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        if (l+rb<ra) c=2; else
			if (l+ra<rb) c=-2; else
				if (l>ra+rb) c=0; else c=1;
        cout << c << 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.r >= 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;
	}
}