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 <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {

  double xa,ya,ra;
  double xb,yb,rb;

  int n;
  
  double d,diff;
  int i;


  scanf("%d",&n);

  for(i=0;i<n;i++) {

    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);

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

    diff=fabs(rb-ra);

    if(d>ra+rb) printf("0\n");

    else if(d<=ra+rb && d>diff) printf("1\n");

    else if(ra>rb) printf("2\n");

    else printf("-2\n");

  }

  return 0;

}

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


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

  for(int i=0;i<n;i++){
    std::cin >> xa >> ya >> ra
             >> xb >> yb >> rb;
    d = std::sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    /*if(ra+rb < d){
      std::cout << (int)0 << std::endl;
      break;
    }
    if(ra+d < rb){
      std::cout << (int)-2 << std::endl;
      break;
    }
    if(rb+d < ra){
      std::cout << (int)2 << std::endl;
    }else{
      std::cout << (int)1 << std::endl;
    }*/
    std::cout << (d<=ra+rb?d+rb>=ra?d+ra>=rb?1:-2:2:0) << std::endl;
  }
}

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		double d = abs(ax-bx)*abs(ax-bx) + abs(ay-by)*abs(ay-by);
		d = sqrt(d);
		//printf("%f\n", d);
		if (d > ra+rb) puts("0");
		else if (d < ra && d > rb) puts("2");
		else if (d < rb && d > ra) puts("-2");
		else puts("1");
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

double dir(double x1, double y1, double x2, double y2){
    return hypot(abs(x1-x2),abs(y1-y2));
}

const double EPS = (1e-9);

int main(){
    int n;
    cin>>n;
    rep(loop,n){
        double x[2], y[2], r[2];
        rep(i,2)cin>>x[i]>>y[i]>>r[i];
        
        double direct = dir(x[0],y[0],x[1],y[1]);
        if(direct>r[0]+r[1]+EPS)cout<<0<<endl;
        else if(direct+r[1]<=r[0]+EPS)cout<<2<<endl;
        else if(direct+r[0]<=r[1]+EPS)cout<<-2<<endl;
        else cout<<1<<endl;
    }
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar))return puts("-2")*0;
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar))return puts("2")*0;
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<=(ar+br))return puts("1")*0;
        swap(a.first,a.second); swap(b.first,b.second);
        if(abs(a.first-b.first)<=(ar+br))return puts("1")*0;
        else puts("0");
        
    }
}

C++: /*
 *	
 *	Created by Ziyi Tang
 *	
 */

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
using namespace std;
#define INF (int)1E9
#define INFL (long)1E18
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef vector<vpi> vvpi;
const int dir[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};


int main(){
	int test;
	cin >> test;
	while(test--){
		double x1,y1,r1,x2,y2,r2;
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		double up1 = y1+r1;
		double down1 = y1-r1;
		double left1 = x1-r1;
		double right1 = x1+r1;

		double up2 = y2+r2;
		double down2 = y2-r2;
		double left2 = x2-r2;
		double right2 = x2+r2;
		int flag = -10;

		if ((left1 >= left2 && right1 < right2 && up1 < up2 && down1 > down2) ||
			(left1 > left2 && right1 <= right2 && up1 < up2 && down1 > down2) ||
			(left1 > left2 && right1 < right2 && up1 <= up2 && down1 > down2) ||
			(left1 > left2 && right1 < right2 && up1 < up2 && down1  > down2)){
				flag = -2;
		}
		if ((left1 <= left2 && right1 > right2 && up1 > up2 && down1 < down2) ||
			 (left1 < left2 && right1 >= right2 && up1 > up2 && down1 < down2) ||
			 (left1 < left2 && right1 > right2 && up1 >= up2 && down1 < down2) ||
			 (left1 < left2 && right1 > right2 && up1 > up2 && down1  < down2)){
				flag = 2;
		}
		if (flag == -10){
			double dis = -1 ;
			dis = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
			if (dis > r1+r2){
				flag = 0;
			}
			else{
				flag = 1;
			}
		}
		
		cout << flag << endl;
	}





	return 0;
}

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

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	//cin>>dataN;
	for (int i = 0; i < dataN; i++) {
		double ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		//cin>>ax>>ay>>ra>>bx>>by>>rb;
		double d = (ax-bx)*(ax-bx) + (ay-by)*(ay-by);

		d = sqrt(d);

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

C++: //#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>

using namespace std;


int main(){

	int n, ans;
	double xa, ya, ra, xb, yb, rb;
	double R;

	cin >> n;

	while (n--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

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

		if (R > ra + rb){
			ans = 0;
		}
		else{
			ans = 1;
			if (ra > R + rb)ans = 2;
			if (rb > R + ra)ans = -2;
		}

		cout << ans << endl;

	}

	return 0;
}