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 <cmath>
using namespace std;

int main(){
  double x1,y1,r1,x2,y2,r2,ans;
  int n;
  cin >> n;
  while(n--){
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    double len = sqrt(pow(x1-x2,2) + pow(y1-y2,2));
    if( len + r2 < r1){
      ans = 2;
    } else if(len + r1 < r2){
      ans = -2;
    } else if(len <= r1 + r2){
      ans = 1;
    } else {
      ans = 0;
    }
    cout << ans << endl;
  }
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
#define int long long
signed main(){
	int n;
	scanf("%lld",&n);
	for(int i=0;i<n;i++){
		double xa,ya,ra,xb,yb,rb;
		scanf("%lf %lf %lf %lf %lf %lf",&xa, &ya, &ra, &xb, &yb, &rb);
		double d = sqrt(pow(xa-xb,2)+pow(ya-yb,2));
		if( rb+d < ra ) cout << "2" << endl;
		else if( ra+d < rb ) cout << "-2" << endl;
		else if( d < ra+rb) cout << "1" << endl;
		else cout << "0" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define rep(i, n)      for (int i=0; i<int(n); i++)
#define rep3(i, s, n)  for (int i=int(s); i<int(n); i++)
#define rev_rep(i, n)  for (int i=int(n)-1; i>=0; i-=1)

int N;

int main() {
  cin >> N;
  rep(i, N) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double dist_p = (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb);
    int ans = 0;
    if (dist_p < (ra+rb)*(ra+rb)) ans = 1;
    if (ra > rb && dist_p <= (ra-rb)*(ra-rb)) ans =  2;
    if (ra < rb && dist_p <= (rb-ra)*(rb-ra)) ans = -2;
    cout << ans << "\n";
  }
  return 0;
}

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

int main(){
	int N;
	std::cin >> N;
	
	while(N--){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = hypot((xa - xb), (ya - yb)); //distance
		
		if(d > ra + rb)
			std::cout << 0 << std::endl;
		else if(d < fabs(ra - rb))
			std::cout << (ra > rb ? 2 : -2) << std::endl;
		else
			std::cout << 1 << std::endl;
	}
    return 0;
}

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

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 long long LL;
typedef unsigned long long ULL;

//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(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

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

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   int n;
   double x[2],y[2],r[2];
   cin>>n;
   REP(i,n){
      REP(j,2) cin >> x[j] >> y[j] >> r[j];
      if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))>r[1]+r[0])
         cout << "0" << endl;
      else if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))+r[1]<r[0])
         cout << "2" << endl;
      else if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))+r[0]<r[1])
         cout << "-2" << endl;
      else cout << "1" << endl;
   }
}

C++: //SKDLKASDL+KASL+DKSAL+DK+LKASD
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define roop(a,t) for(int a=0;a<t;a++) 
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	ld x[2], y[2], r[2];
	ll n;
	cin >> n;
	roop(i, n) {
		roop(lp, 2) {
			cin >> x[lp] >> y[lp] >> r[lp];
		}
		ld ab = sqrt((x[0] - x[1])*(x[0] - x[1]) + (y[0] - y[1])*(y[0] - y[1]));
		if (r[0] + r[1] < ab) { cout << 0 << endl; continue; }
		else if (r[0] + r[1] == ab) { cout << 1 << endl; continue; }
		else {
			if (r[0] > r[1]) {
				if (r[0] > r[1] + ab) { cout << 2 << endl; continue; }
			}
			else {
				if (r[1] > r[0] + ab) { cout << 2 << endl; continue; }
			}
		}cout << 1 << endl;

	}
	return 0;
}

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


using namespace std;

int main(){
  int datasets = 0;
  cin >> datasets;

  for(int i=0;i<datasets;i++){
    double xa,ya,ra,xb,yb,rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    //dis
    double dis = sqrt(pow(xa-xb, 2) + pow(ya-yb,2));
    
    if(ra+rb < dis){
      cout << "0" << endl;
      continue;
    }

    if(ra-rb > dis){
      cout << "2" << endl;
      continue;
    }

    if(rb-ra > dis){
      cout << "-2" << endl;
      continue;
    }

    if(ra+rb >= dis){
      cout << "1" << endl;
      continue;
    }
  }
}