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++: /* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 
                                                           
*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define print(x) cout << x << '\n'
#define Fi first
#define Se second

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define DEPS(i, a, n) for (int i = (a); i >= n; i--)
#define DEP(i, n) for (int i = (n); i >= 0; i--)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool is_uruu(int y) {return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;}
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}

/* }}} */

#define sq(x) ((x) * (x))

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;

  while (n--){
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(sq(xa - xb) + sq(ya - yb));

    if (d < ra - rb){
      print("2");
    } else if (d < rb - ra){
      print("-2");
    } else if (d <= ra + rb){
      print("1");
    } else {
      print("0");
    }
  }

  return 0;
}

C++: 
#include<iostream>

#include<math.h>
using namespace std;



main(){

  int n;
  double xa,ya,xb,yb;
  double ra,rb;
  int out ;
  cin >> n;

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

    double d= sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );//
    
    if(d<fabs(ra-rb)){//
      out = 2;
      if(ra<rb)out= -2;
          }
    else if(d>(ra+rb))out = 0;//
    else out =1;//
    
    cout << out << endl;
    
  }


  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

using namespace std;

int n, out;
double x[2], y[2], r[2], dst;

int main()
{
	
	cin >> n;
	
	while(n--)
	{
		
		for( int i = 0; i < 2; i++)
		{
			cin >> x[i] >> y[i] >> r[i];
		}
		
		dst = sqrt( pow(x[1] - x[0], 2) + pow(y[1] - y[0], 2) );
		
		if( dst > r[0] + r[1] )
			out = 0;
		else if( abs(r[0] + r[1]) >= dst && dst >= abs(r[0] - r[1]))
			out = 1;
		else 
			out = r[0] > r[1] ? 2 : -2;
		
		cout << out << endl;
		
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
#define y imag()
#define x real()
using namespace std;
typedef complex<double> P;

int main(){
  int n;
  P a,b;
  double ra,rb,d;
  cin>>n;
  while(n--){
    cin>>a.x>>a.y>>ra;
    cin>>b.x>>b.y>>rb;
    double A=a.x-b.x;
    double B=a.y-b.y;
    d=sqrt(A*A+B*B);
    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 "bits/stdc++.h"
using namespace std;

int main() {
	int T; cin >> T;
	for (int t = 1; t <= T;t++) {
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		double dist = pow(xa - xb, 2) + pow(ya - yb, 2);
		if (pow(ra + rb, 2) < dist) {
			cout << 0 << endl;
		}
		else {
			if (dist < pow(ra - rb, 2) && rb < ra) {
				cout << 2 << endl;
			}
			else if(dist < pow(ra - rb,2) && ra < rb){
				cout << -2 << endl;
			}
			else {
				cout << 1 << endl;
			}
		}
	}
}

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

inline float distance_pow2(float xa, float ya, float xb, float yb){
	return (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb);
}

inline int judge(std::vector<float> ve){
	float center_dis = distance_pow2(ve[0], ve[1], ve[3], ve[4]);
	float r_dis = (ve[2] + ve[5])*(ve[2] + ve[5]);
	if(center_dis > r_dis){
		return 0;	
	}else{
		if(center_dis <= ve[2]*ve[2] && center_dis <= ve[5]*ve[5]){
			return ve[2] > ve[5] ? 2 : -2;
		}else{
			return 1;
		}
	}
}

int main(void){
	int num;
	std::vector<float> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

C++: #include <iostream>
//#include <algorithm>
#include "math.h"

using namespace std;

int main(){
	int count;
	double xa,ya,ra,xb,yb,rb;
	cin >> count;
	for(int i=0;i<count;i++){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dist = pow((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb),0.5);
		//		double dist = (xa-xb)*(xa-xb)+(xa-xb)*(xa-xb);
		//cout << dist << endl;
		if(dist>ra+rb){
			cout << 0 << endl;
		}
		else if(dist > ra - rb && dist > rb - ra){
			cout << 1 << endl;
		}
		else if(ra>rb){
			cout << 2 << endl;
		}
		else{
			cout << -2 << endl;
		}
	}
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,r,n) for(int i=r;i<(int)n;i++)
using namespace std;
int in(){int x;cin>>x;return x;}
int n;
vector<int> a,b,c;

int main ()
{
	cin>>n;
	while(n--)
	{
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double half=sqrt((bx-ax)*(bx-ax)+(by-ay)*(by-ay));
		if(half-ar-br>0)
		{
			cout<<0<<endl;
		}
		else if(half-ar-br<=0&&half-ar-br>min(-ar,br))
		{
			cout<<1<<endl;
		}
		else
		{
			if(ar>br)
			{
				cout<<2<<endl;
			}
			else cout<<-2<<endl;
		}
	}

	return 0;
}

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

using namespace std;

int intersection(double xa,double ya,double ra,double xb,double yb,double rb)
{
	double d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
	if(ra+rb<d)
	{
		return 0;
	}
	else if(ra+d<rb)
	{
		return -2;
	}
	else if(rb+d<ra)
	{
		return 2;
	}
	else{
		return 1;
	}
}

int main(void)
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		double xa,ya,ra,xb,yb,rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		cout<<intersection(xa,ya,ra,xb,yb,rb)<<endl;
	}
}

C++: RMSHYJAE

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

using namespace std;

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

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

        if (d > ra + rb) 
            cout << 0 << endl;
        else if (d < abs(ra - rb))
            cout << 2 << endl;
        else if (d < abs(rb - ra))
            cout << -2 << endl;
        else if ((abs(ra - rb) < d) && (d < abs(ra + rb)))
            cout << 1 << endl;
    }

    return 0;
}