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;
#define PI 3.14
int main(void)
{
  double xa,ya,ra,xb,yb,rb;
  double areaa,areab;
  double len;
  int n;
  
  cin >> n;
  for(int i = n ; i > 0 ; i--){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    
    areaa = ra * ra * PI;
    areab = rb * rb * PI;

    len = abs(xa - xb) * abs(xa - xb) + abs(ya - yb) * abs(ya - yb);
    len = sqrt(len);

    if(len > ra + rb) cout << 0 << endl;
    else if(ra + yb > len && len > ra - rb) cout << 1 << endl;
    else if(len < ra - rb && areaa > areab) cout << 2 << endl;
    else if(len < ra - rb && areab > areaa) cout << -2 << endl;
  }
  return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
struct en{
	pair<double, double> pos;
	double r;
};
int main() {
	int n;
	cin >> n;
	while (n--){
		en e1,e2;
		cin >> e1.pos.first >> e1.pos.second >> e1.r >> e2.pos.first >> e2.pos.second >> e2.r;
		double dis = hypot(e1.pos.first - e2.pos.first, e1.pos.second - e2.pos.second);
		if (e1.r>e2.r&&dis + e2.r<e1.r)cout << 2 << endl;
		else if (e1.r<e2.r&&dis+e1.r<e2.r)cout << -2 << endl;
		else if (e1.r + e2.r>=dis)cout << 1 << endl;
		else cout << 0 << endl;
	}
}

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

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

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = hypot(xa - xb, ya - yb);
		if (d > ra + rb)
		{
			std::cout << 0 << std::endl;
		}
		else
		{
			if (d == ra + rb || abs(ra - rb) < d)
			{
				std::cout << 1 << std::endl;
			}
			else
			{
				std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	while(n--){
		int a;
		double x[2], y[2], r[2], d2;
		for(int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i];
		d2 = (x[1]-x[0])*(x[1]-x[0]) - (y[1]-y[0])*(y[1]-y[0]);
		if(d2 > (r[0]+r[1])*(r[0]+r[1]) ) a = 0;
		else if(d2 > (r[0]-r[1])*(r[0]-r[1]) ) a = 1;
		else  r[0]>r[1] ? a = 2 : a = -2;
		cout << a << endl;
	}
	return 0;
}

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

int main(){
	double xa,ya,ra,xb,yb,rb;
	int n;
	cin>>n;
	while(n--){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		if(d+rb < ra)cout<<2;
		else if(d+ra < rb)cout<<-2;
		else if(d <= ra+rb)cout<<1;
		else cout<<0;
		cout<<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<complex>
#include<complex>
#include<cmath>
using namespace std;

typedef complex<double> P;

const double eps = 1e-10;

//
//0:a include b
//1:intersected
//2:same
//3:far away
// r1 >= r2
int is_intersected_circle(P a,P b,double r1,double r2){
  double d = abs(a-b);
  if (d<eps && abs(r1-r2)<eps)return 2;
  if  (d+r2 < r1)return 0;//(fabs(r1-r2)<d if dont care a(b) include another
  if (d > r1+r2)return 3;

  
  return 1;
}

main(){
  int op[2][4]={{2,1,100,0},
  {-2,1,100,0},};
  P a,b;
  double r1,r2;
  int te;
  cin>>te;
  while(te--){
    cin>>a.real()>>a.imag()>>r1>>
      b.real()>>b.imag()>>r2;

    if (r1 >= r2)
      cout << op[0][is_intersected_circle(a,b,r1,r2)]<<endl;
    else
      cout << op[1][is_intersected_circle(b,a,r2,r1)]<<endl;
  }
  
}