Go: package main

import (
        "fmt"
        "math"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                var ax, ay, ar, bx, by, br float64
                fmt.Scanf("%f %f %f %f %f %f", &ax, &ay, &ar, &bx, &by, &br)

                d := math.Sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay))
                if d <= ar + br {
                        if ar > br {
                                if ar > br + d {
                                        fmt.Println("2")
                                } else {
                                        fmt.Println("1")
                                }
                        } else {
                                if br > ar + d {
                                        fmt.Println("-2")
                                } else {
                                        fmt.Println("1")
                                }
                        }
                } else {
                        fmt.Println(0)
                }
        }
}

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

typedef struct  circle{

    double x;
    double y;
    double r;
}CIRCLE;

int main(void){

    CIRCLE a,b;
    int n;
    double sum,diff1,diff2,len;

    cin >> n;

    while(n > 0){

        cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;

            sum = a.r + b.r;
            diff1 = a.r - b.r;
            diff2 = b.r - a.r;
            len = sqrt(pow(a.x - b.x,2.0) + pow(a.y - b.y,2.0));

            if(diff1 > len){
                cout << "2" << endl;
            }else if(diff2 > len){
                cout << "-2" << endl;
            }else if(fabs(diff1) <= len && len <= fabs(diff2)){
                cout << "1" << endl;
            }else{
                cout << "0" << endl;
            }

        n--;
    }

    return 0;
}

C++: #include <cstdio>
#include <complex>
#include <vector>
#include <cmath>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-10;

#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)
#define LE(x,y) (x < y + EPF)
#define GE(x,y) (x + EPF > y)

double dot(P a, P b) {
  return (conj(a)*b).X;
}
double cross(P a, P b) {
  return (conj(a)*b).Y;
}
int isparallel(P a, P b, P c, P d) {//ab,cd
  return EQ(cross(a-b, c-d),0);
}
double distPP(P a, P b) {
  return sqrt(dot(a-b,a-b));
}
int relationCC(P c1, double r1, P c2, double r2) {//0..not overlap, 1..intersect, 2..2isin1, -2..1isin2
  double d2 = dot(c1-c2,c1-c2);
  double prr = (r1+r2)*(r1+r2);
  double mrr = (r1-r2)*(r1-r2);
  if(GE(d2 ,prr)) return 0;
  else if(GE(mrr, d2)) {
    if(r1 > r2) return 2;
    else return -2;
  }
  else return 1;
}
P intersection(P a, P b, P c, P d) {//ac , bd
  double d1 = cross(d-b,b-a);
  double d2 = cross(d-b,c-a);
  if(EQ(d1,0) & EQ(d2,0)) return a;
  if(EQ(d2,0)) return a;
  return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
  P b(-a.Y, a.X);
  return b;
}
P polar(double r, double theta) {
  P a(r*cos(theta),r*sin(theta));
  return a;
}


int main() {
  int n;
  scanf("%d",&n);
  REP(i,n) {
    double x,y,r1,r2;
    scanf("%lf %lf %lf", &x, &y, &r1);
    P a(x,y);
    scanf("%lf %lf %lf", &x, &y, &r2);
    P b(x,y);
    printf("%d\n", relationCC(a,r1,b,r2));
  }
  return 0;
}

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

using namespace std;

typedef complex<double> Point;

//ツ円Aツつェツ円Bツづーツ環ョツ全ツづ可甘慊づ楪つゥツ板サツ津ィツつキツづゥ
bool includesCircle(const Point &ca, double ra, const Point &cb, double rb) {
    return norm(ca-cb) < pow(ra-rb, 2) && rb < ra;
}

//ツ円Aツづ円Bツつェツ古ーツづュツづづつ「ツづゥツつゥツ板サツ津ィツつキツづゥ
bool intersectsCircle(const Point &ca, double ra, const Point &cb, double rb) {
    return norm(ca-cb) < pow(ra+rb, 2);
}

int main() {
    int N;
    cin >> N;
    while(N--) {
        Point ca, cb;
        double ra, rb;
        cin >> ca.real() >> ca.imag() >> ra >> cb.real() >> cb.imag() >> rb;
        if(includesCircle(ca, ra, cb, rb)) cout << 2 << endl;
        else if(includesCircle(cb, rb, ca, ra)) cout << -2 << endl;
        else if(intersectsCircle(ca, ra, cb, rb)) cout << 1 << endl;
        else cout << 0 << endl;
    }
    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 >= abs(ra - rb))
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int n,i;
  double xa,ya,ra,xb,yb,rb;
  double dist;

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );

    if(dist>ra+rb)
      cout<<"0"<<endl;
    else if(ra<dist || dist==0)
      cout<<"1"<<endl;
    else if(rb<ra)
      cout<<"2"<<endl;
    else if(ra<rb)
      cout<<"-2"<<endl;
  }
}

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

#define TIMES(i) while(i--)
#define REP(i, n) for ( int i = 0; i < n; i++ )

using namespace std;

int main() {
    int n;
    cin >> n;

    TIMES(n) {
        // ??\???
        double ax, ay, ar, bx, by, br;
        cin >> ax >> ay >> ar >> bx >> by >> br;

        // ?????¢????±???????
        double dis_x = abs(ax-bx),
            dis_y = abs(ay-by),
            dist = sqrt(dis_x * dis_x + dis_y * dis_y);

        // cout << dis_x << " " << dis_y << " " << dist << endl;

        // ??¢????????????
        if ( dist > ar + br ) {
            cout << 0;

        // a????????????????????????
        } else if ( dist + ar < br ) {
            cout << -2;

        // b????????????????????????
        } else if ( dist + br < ar ) {
            cout << 2;

        // ????????£?????????
        } else {
            cout << 1;
        }
        cout << endl;
    }

    return 0;
}

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

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

        double rsum = (ra+rb)*(ra+rb), rdiff = ra-rb;
        double cntr_dst = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if(rdiff>0 && rdiff*rdiff>cntr_dst){
            cout << 2;
        }else if(rdiff<0 && rdiff*rdiff>cntr_dst){
            cout << -2;
        }
        else if(rsum>cntr_dst && cntr_dst>rdiff*rdiff){
            cout << 1;
        }
        else if(rsum<cntr_dst){
            cout << 0;
        }
        cout << endl;
    }
    return 0;
}

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

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

	int n;
	cin >> n;

	while(n > 0){
		double xa, xb, xr;
		double ya, yb, yr;

		cin >> xa >> xb >> xr;
		cin >> ya >> yb >> yr;

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

		if(d > xr + yr) cout << 0 << endl;
		else if(xr > yr && d < xr) cout << 2 << endl;
		else if(yr > xr && d < yr) cout << -2 << endl;
		else cout << 1 << endl;
		--n;
	}
	
	return 0;
}