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 <cmath>
#include <iostream>
using namespace std;
#define EPS 1e-12
int main()
{
    int n; cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = hypot(xa-xb, yb-yb);
        int res = 1;
        if (ra > rb) {
            if (d < ra - rb) res = 2;
            else if (d > ra + rb) res = 0;
        }
        else {
            if (d < rb - ra) res = -2;
            else if (d > ra + rb) res = 0;
        }
        cout << res << endl;
    }
    return 0;
}

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

using namespace std;

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

int main() {
  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;
    double d = sqrt(sq(xb-xa)+sq(yb-ya));
    if (d > ra + rb)
      cout << 0 << endl;
    else if (ra >= d + rb)
      cout << 2 << endl;
    else if (rb >= d + ra)
      cout << -2 << endl;
    else
      cout << 1 << endl;
  }
  return 0;
}

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

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        float xa, ya, ra;
        float xb, yb, rb;
        float d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); // distance of o1 and o2
        
        if ((d < ra - rb) && (ra > rb))
        {
            cout<<2<<endl;
        }
        else if ((d < rb - ra) && (ra < rb))
        {
            cout<<-2<<endl;
        }
        else if (d >= abs(ra - rb) && (d < ra + rb))
        {
            cout<<1<<endl;
        }
        else if (d > ra + rb)
        {
            cout<<0<<endl;
        }
//        else
//        {
//            cout<<1<<endl;
//        }
    }
}

int main()
{
    Solution();
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

istream &operator >> (istream &is, Circle &c)
{
    return is >> c.x >> c.y >> c.r;
}

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

int main()
{
    int N;    
    Circle c1, c2;
    cin >> N;
    while (N--) {
        cin >> c1 >> c2;
        double d = dist(c1.x, c1.y, c2.x, c2.y);
        if (c1.r + c2.r < d) {
            cout << 0 << endl;
        } else if (c2.r + d < c1.r) {
            cout << 2 << endl;
        } else if (c1.r + d < c2.r) {
            cout << -2 << endl;
        } else {
            cout << 1 << endl;
        }
    }    
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<cmath>
using namespace std;
struct circle {
	double x;
	double y;
	double r;
};
int main() {
	enum ins{A_isin_B,B_isin_A,Intersect,isnot};
	vector<ins>l;
	circle c1, c2;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> c1.x >> c1.y >> c1.r >> c2.x >> c2.y >> c2.r;
		double dis = sqrt((c2.x - c1.x)*(c2.x - c1.x) + (c2.y - c1.y)*(c2.y - c1.y));
		if (c1.r + c2.r < dis)l.push_back(isnot);
		else if (dis + c1.r <= c2.r)l.push_back(A_isin_B);
		else if (dis + c2.r <= c1.r)l.push_back(B_isin_A);
		else l.push_back(Intersect);
	}
	for (ins i : l) {
		if (i == A_isin_B)cout << -2;
		else if (i == B_isin_A)cout << 2;
		else if (i == isnot)cout << 0;
		else cout << 1;
		cout << endl;
	}
}

C++: #include<stdio.h>
#include<stdlib.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 d=sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
		if(d>ra+rb)printf("0\n");
		else if(d>abs(ra-rb))printf("1\n");
		else{
			if(ra>rb)printf("2\n");
			if(ra<rb)printf("-2\n");
		}
	}
	return 0;
}

C++: #include <stdio.h>
struct circle{
    long double x;
    long double y;
    long double r;
};
long double abs(long double a){
    if(a<0)return -a;
    return a;
}
long double range(circle a,circle b){
    return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
}
int main(){
    int n;
    circle a[2];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        for(int j=0;j<2;j++)scanf("%Lf%Lf%Lf",&a[j].x,&a[j].y,&a[j].r);
        if((a[0].r+a[1].r)*(a[0].r+a[1].r)<range(a[0],a[1])){
            printf("0\n");
        }
        else if(range(a[0],a[1])>=abs(a[0].r-a[1].r)*abs(a[0].r-a[1].r)&&range(a[0],a[1])<=(a[0].r+a[1].r)*(a[0].r+a[1].r)){
            printf("1\n");
        }
        else{
            if(a[0].r>a[1].r)printf("2\n");
            else printf("-2\n");
        }
    }
}

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

using namespace std;

int main() {
  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;
    double d = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
    if (d+ra < rb) cout << -2 << endl;
    else if (d+rb < ra) cout << 2 << endl;
    else if (d < ra+rb) cout << 1 << endl;
    else cout << 0 << endl;
  }
  return 0;
}

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)<=2*(ar+br)||abs(a.first-b.first)==min(ar,br))return puts("1")*0;
        else puts("0");
        
    }
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double pitagoras(double x1,double y1,double x2,double y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

main(){
  int n;
  scanf("%d",&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 r=pitagoras(xa,ya,xb,yb);
    if(r+ra <= rb) printf("-2\n");
    else if(r+rb <= ra) printf("2\n");
    else if(ra+rb >= r) printf("1\n");
    else printf("0\n");
  }
}