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<stdio.h>
#include<math.h>
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		double xa,xb,ya,yb,ra,rb;
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		double l;
		if(ra>rb){
			l=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
			if(l<(ra-rb))printf("2");
			else if(l>=(ra-rb)&&l<=(ra+rb))printf("1");
			else printf("0");}
		else{
			l=sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
			if(l<(rb-ra))printf("-2");
			else if(l>=(rb-ra)&&l<=(ra+rb))printf("1");
			else printf("0");}
		printf("\n");}
	return 0;}

C++: #include <cmath>
#include <iostream>
using namespace std;
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 <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;

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

double getDistance(circle a, circle b)
{
    return sqrt(pow(a.x - b.x ,2)
            +pow(a.y - b.y ,2));
}

int main()
{
    int n;
    circle a, b;
    double distance;
    cin >> n;
    for(int c = 0; c < n; c++)
    {
        cin >> a.x >> a.y >> a.r
            >> b.x >> b.y >> b.r;
        distance = getDistance(a, b);
        if(abs(a.r + b.r) < distance)
            cout << 0 << endl;
        else {
            if(a.r - b.r > distance)
                cout << 2 << endl;
            else if(abs(a.r - b.r) > distance && a.r + b.r > distance)
                cout << 1 << endl;
            else if(b.r - a.r > distance)
                cout << -2 << endl;
        }
    }
    return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
double EPS=1e-10;
double add(double a, double b)
{
	if(abs(a+b)<EPS*(abs(a)+abs(b)) ) return 0;
	else return a+b;
}
int main()
{
	int n ; cin >> n ;
	while(n--)
	{
		double x[2],y[2],r[2];
		for(int i=0;i<2;i++) cin >> x[i] >> y[i] >> r[i] ;
		double dist2=add( (x[1]-x[0])*(x[1]-x[0]),(y[1]-y[0])*(y[1]-y[0]) );
		int ans=0;
		if(dist2<r[0]*r[0]) ans=2;
		else if(dist2<r[1]*r[1]) ans=-2;
		else if(dist2<=add(r[0],r[1])*add(r[0],r[1])) ans=1;
		cout << ans << '\n' ;
	}
}

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

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

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

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

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

int main(){
	
	int n,z;
	double x1,y1,r1;
	double x2,y2,r2;
	
	cin>>n;
	
	for(int i=0;i<n;i++){
		cin >> x1 >> y1 >> r1 ;
		cin >> x2 >> y2 >> r2 ;
		
		double m = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ) ;
		
		if( r1 > m+r2 ) z=2;
		else if( r2 > m+r1 ) z=-2;
		else{
			if( r1+r2 >= m ) z=1;
			else z=0;
		}
		
		cout << z << endl;
	}
return 0;
}

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

using namespace std;

int main()
{
	double xa, ya, ra, xb, yb, rb, distance, x, y;
	int i = 0, j = 0;

	cin >> i;
	while ( j < i )
	{
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		x = xa - xb;
		y = ya - yb;
		distance = sqrt( x*x + y*y );

		if ( ra >= rb )
		{ // circle a bigger than circle b
			if ( distance > ra + rb )
			{ // circle b in circle a 
				cout << 0 << endl;
			}
			else if ( distance <= ra + rb && distance >= ra - rb )
			{
				cout << 1 << endl;
			}
			else if ( distance < ra - rb )
			{
				cout << 2 << endl;
			}
		}

		if ( rb > ra )
		{ // circle b bigger than circle a
			if ( distance > rb + ra )
			{ // circle a in circle b
				cout << 0 << endl;
			}
			else if ( distance <= ra + rb && distance >= rb - ra )
			{
				cout << 1 << endl;
			}
			else if ( distance < rb - ra )
			{
				cout << -2 << endl;
			}
		}

		j = j + 1;
	}

	return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r = pow(pow(xb - xa, 2) + pow(yb - ya, 2), (float)1.0/2);
		if (r > ra + rb) {
			cout << 0 << endl;
		}
		else if (r <= ra + rb) {
			if (ra >= rb) {
				if (r <= ra - rb) {
					cout << 2 << endl;
				}
				else if (r > ra - rb) {
					cout << 1 << endl;
				}
			}
			else if (ra < rb) {
				if (r <=rb - ra) {
					cout << -2 << endl;
				}
				else if (r > rb - ra) {
					cout << 1 << endl;
				}
			}
		}
	}
	return 0;
}