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)
                }
        }
}

Python: n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())
    if xa - ra < xb - rb and xa + ra > xb + rb and ya - ra < yb - rb and ya + ra > yb + rb:
        print(2)
    elif xa - ra > xb - rb and xa + ra < xb + rb and ya - ra > yb - rb and ya + ra < yb + rb:
        print(-2)
    elif (xa - xb)**2 + (ya - yb)**2 <= (ra + rb)**2:
        print(1)
    else:
        print(0)

Python: # ??????????????¢??¨????????????, ????????¢???
def plus(a, b):
    return a + b


def minus(a, b):
    return abs(a - b)


def distance(x1, y1, x2, y2):
    r2 = (x1 - x2)**2 + (y1 - y2)**2
    return pow(r2, 0.5)


def flag(l):
    rp = plus(l[2], l[5])
    rm = minus(l[2], l[5])
    d = distance(l[0], l[1], l[3], l[4])
    if rp < d:
        return 0
    elif d < rm:
        if l[5] < l[2]:
            return 2
        else:
            return -2
    else:
        return 1


N = int(input())
for i in range(N):
    a = list(map(float, input().split()))
    print(flag(a))

Python: 
import math

N = int(input())
for _ in range(N):
	[Xa,Ya,Ra,Xb,Yb,Rb] = [float(element) for element in input().split()]
	distance = math.sqrt((Xa - Xb)**2 + (Ya - Yb)**2) # Compute distance from point A to point B
	if Ra - Rb - distance > -10E-16: # B in A
		print(2)
	elif Rb - Ra - distance > -10E-16: # A in B
		print(-2)
	elif Ra + Rb - distance > -10E-16: # Intersect
		print(1)
	else: # Not overlap
		print(0)

Python: 
import sys,math
cases = int(input())
i = 0
while i < cases:
   for line in sys.stdin.readlines():
       xa , ya , ra , xb , yb , rb = map(float,line.split())
       dist = (yb - ya)*(yb - ya) + (xb - xa)*(xb - xa)
       dist = math.sqrt(dist)
       if (ra < rb and dist == 0):
           print("-2")
       elif (rb < ra and dist == 0):
           print("2")
       elif (ra - rb or rb - ra) < dist < ra + rb:
           print("1")
       elif dist > ra + rb :
           print("0")
   i += 1

Python: import math

n = int(input())
for i in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())
    d = math.sqrt((xb - xa) ** 2 + (yb - ya) ** 2)
    if d < ra - rb:
        print(2)
    elif d < rb - ra:
        print(-2)
    elif d <= ra + rb:
        print(1)
    else:
        print(0)

Python: import math
count = int(input())
for i in range(count):
    x1,y1,r1,x2,y2,r2 =map(float,input().split())
    depth=math.sqrt((x1-x2)**2+(y1-y2)**2)
    if depth+r2<=r1:
        print(2)
    elif depth+r1<=r2:
        print(-2)
    elif depth>r1+r2:
        print(0)
    else:
        print(1)

Python: 
import math

N = eval(input())
for _ in range(N):
	[Xa,Ya,Ra,Xb,Yb,Rb] = [float(element) for element in input().split()]
	distance = math.sqrt((Xa - Xb)**2 + (Ya - Yb)**2) # Compute distance from point A to point B
	if abs(Ra - Rb - distance) > 10E-8: # B in A
		print(2)
	elif abs(Rb - Ra - distance) > 10E-8: # A in B
		print(-2)
	elif abs(Ra + Rb - distance) > 10E-8: # Intersect
		print(1)
	else: # Not overlap
		print(0)

Python: from math import hypot

n = int(input())
for i in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())
    d = hypot(xb - xa, yb - ya)
    if ra + rb < d:
        print(0)
    elif abs(ra - rb) <= d:
        print(1)
    elif rb < ra:
        print(2)
    else:
        print(-2)

Python: import sys
import math

n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())

    distance = math.sqrt((xa-xb)**2 + (ya-yb)**2)
    if ra + rb < distance:
        if (ra < rb and distance + ra < rb):
            print(-2)
        elif (rb < ra and distance + rb < ra):
            print(2)
        else:
            print(1)
    else:
        print(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;
    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 <vector>
#include <cmath>
#include <set>
using namespace std;
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<n;i++)

class C{
public:
	double x;
	double y;
	double r;
};

double euc(C a,C b){
	a.x -= b.x;
	a.y -= b.y;
	return sqrt(a.x*a.x+a.y*a.y);
}

int main(){
	int n;
	C a,b;
	cin >> n;
	while(n--){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		if( euc(a,b)+b.r <= a.r && a.r > b.r ){
			cout << 2 << endl;
		
		}else if( euc(a,b)+a.r <= b.r && b.r > a.r ){
			cout << -2 << endl;
		}else if(euc(a,b) < b.r ){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
}

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

int main(){
	int n;
	cin >> n;
	for(; 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+rb < ra) cout << 2 << endl;
		else if(d+rb == ra) cout << 1 << endl;
		else if(d+ra < rb) cout << -2 << endl;
		else if(d+ra == rb) cout << 1 << endl;
		else if(d <= ra+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 < abs(ra - rb))
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
		else if (d <= ra + rb)
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 0 << std::endl;
		}
	}
	return 0;
}

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;
}