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 <array>

inline double squ_minus(double a, double b){
	double x = a - b;
	return x * x;
}

inline double squ_plus(double a, double b){
	double x = a + b;
	return x * x;
}

int main(){
	int n; // the number of datasets
	std::cin >> n;
	
	for(int i = 0; i < n; ++i){
		std::array<double, 6> cir; // 0:xa, 1:ya, 2:ra, 3:xb, 4:yb, 5:rb
		std::cin >> cir[0] >> cir[1] >> cir[2] >> cir[3] >> cir[4] >> cir[5];

		double dis = squ_minus(cir[0], cir[3]) + squ_minus(cir[1], cir[4]);
		
		if(dis >= squ_plus(cir[2], cir[5])){
			std::cout << "0" << std::endl;
		}else if(dis < squ_minus(cir[2], cir[5])){
			std::cout << (cir[2] > cir[5] ? "2" : "-2") << std::endl;
		}else{
			std::cout << "1" << std::endl;
		}
	}
	return 0;
}

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

double dist(double xa,double ya,double xb,double yb){
	return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
}
int main(){
	double xa,ya,ra,xb,yb,rb;
	int n;
	cin>>n;
	while(n--){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double d = dist(xa,ya,xb,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 <math.h>
using namespace std;

int main(void)
{
	int n, f;
	double xa, xb, ya, yb, ra, rb;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		double distance;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (ra > rb)
		{
			distance = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
			if (distance < (ra - rb)) f = 2;
			else if (distance >= (ra - rb) && distance <= (ra + rb)) f = 1;
			else f = 0;
		}
		else
		{
			distance = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
			if (distance < (rb - ra)) f = -2;
			else if (distance >= (rb - ra) && distance <= (rb + ra)) f = 1;
			else f = 0;
		}
		cout << f << endl;
	}
	return 0;
}

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

inline float distance(float xa, float ya, float xb, float yb){
	return std::sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
}

int judge(std::vector<float> ve){
	float center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(center_dis < ve[2] - ve[5]){
		return 2;
	}else if(center_dis < ve[5] - ve[2]){
		return -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 <stdlib.h>
#include <math.h>
using namespace std;
int main()
{
	int N;
	cin>>N;
	while(N--){
		int ans;
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double x;
		x=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(x>(ar+br))ans=0;
		else if(abs(ar-br)<x&&x<=(ar+br))ans=1;
		else if(x<=abs(ar-br)&&ar>br)ans=2;
		else ans=-2;
		cout<<ans<<endl;
	}
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;

#define EPS 1e-8

int main(){

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

C++: #include <stdio.h>
#include <math.h>
  int main(){
    int n,i;
    double xa,ya,ra,xb,yb,rb;
    scanf("%d",&n);
     for(i=0;i<n;i++){
       scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
       double dis=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);   
       dis = pow(dis,0.5);
       if(dis>ra+rb){
printf("%d\n",0);
continue;
}else if(dis<ra+rb && dis>fabs(ra-rb)){
printf("%d\n",1);
continue;
}else if(dis<fabs(ra-rb)){
	if(ra>rb){
printf("%d\n",2);
	}else{
		printf("%d\n",2);
	}
}
else{
	printf("%d\n",1);
}
}
return 0;
}

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

C++: #include<iostream>

using namespace std;


struct circle{
  double x,y,r;
};

circle c[2];


bool isIn(circle a, circle b){
  return (b.x+b.r < a.x+a.r && b.y+b.r < a.y+a.r);
}

bool cross(circle a, circle b){
  double diff = (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
  return diff <= (a.r+b.r)*(a.r+b.r);
}
int solve(){

  if(isIn(c[0],c[1])) return 2;
  else if(isIn(c[0],c[1]))return -2;
  else if(cross(c[0],c[1])) return 1;
  else return 0;
}

int main(){

  int n;
  cin >> n;
  while(n--){
    for(int i = 0; i < 2; i++)
      cin >> c[i].x >> c[i].y >> c[i].r;

    cout << solve() << endl;
  }
  return 0;
}

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

int main(){
  int n;
  double xa,ya,ra,xb,yb,rb,d;
  cin>>n;
  for(;n>0;n--){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    if(d>ra+rb)
      cout<<0<<endl;
    if(abs(ra-rb)<=d&&d<=ra+rb)
      cout<<1<<endl;
    if(d<ra-rb)
      cout<<2<<endl;
    if(d<rb-ra)
      cout<<-2<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include<math.h>
using namespace std;
int main(){
    double xa,xb,ya,yb,ra,rb;
	double x;
	int n,w;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		x=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
		x=sqrt((double)x);
		if(ra+rb<x)
			w=0;
		else if(ra-rb>=x)
			w=2;
		else if(rb-ra>=x)
			w=-2;
		else
			w=1;
		cout<<w<<endl;
	}
	return 0;
}

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

using namespace std;

inline double sq (double a) {
    return a * a;
}

inline double dist (double x1, double y1, double x2, double y2) {
    return sqrt(sq(x1 - x2) + sq(y1 - y2));
}

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa;
        cin >> ya;
        cin >> ra;
        cin >> xb;
        cin >> yb;
        cin >> rb;
        double d = dist(xa, ya, xb, yb);
        int s;
        if (d + rb <= ra) s = 2;
        else if (d + ra <= rb) s = -2;
        else if (d <= ra + rb) s = 1;
        else s = 0;
        cout << s << endl;
    }
    return 0;
}

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

using namespace std;
typedef long double ld;

const ld eps = 1e-15;

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

        ld dis = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
        if (dis < abs(ra - rb)) {
            cout << (ra > rb ? 2 : -2) << endl;
        } else if (dis <= (ra + rb) + eps) {
            cout << 1 << endl;
        } else {
            cout << 0 << endl;
        }
    }
    return 0;
}