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 <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	double xa, ya, xb, yb, ra, rb;
	vector<int> Decision;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if ((ra+rb)*(ra + rb) < ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)))Decision.push_back(0);
		else if ((ra - rb)*(ra - rb) < ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) && ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) <= (ra + rb)*(ra + rb))Decision.push_back(1);
		else if ((ra - rb)*(ra - rb) > ((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb))) {
			if (ra > rb)Decision.push_back(2);
			else Decision.push_back(-2);
		}
	}
	for (int i = 0; i < Decision.size(); i++)cout << Decision[i] << endl;
	return 0;
}

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 dr = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if(ra > rb+dr)
			cout << 2 << endl;
		else if(rb > ra+dr)
			cout << -2 << endl;
		else if(dr < ra + rb)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 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);
    printf("%lf %lf %lf\n",r,ra,rb);
    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");
  }
}

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

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

auto distance (double x , double y) -> double
{
    return std::sqrt (x * x + y * y);
}

auto solve (const Circle & A , const Circle & B) -> int
{
    auto d = distance (A.x - B.x , A.y - B.y);
    if (d > A.r + B.r)
    {
        return 0;
    }
    else if (std::abs (A.r - B.r) > d)
    {
        return A.r > B.r ? 2 : - 2;
    }
    else
    {
        return 1;
    }
}

auto main () -> int
{
    Circle A , B;
    int n;
    std::cin >> n;
    for (auto i = 0; i < n; ++ i)
    {
        std::cin >> A.x >> A.y >> A.r >> B.x >> B.y >> B.r;
        std::cout << solve (A , B) << std::endl;
    }
}

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

int main(){
	int n;
	cin >> n;
	while(n-->0){
		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(ra>=d+rb) cout << 2 << endl;
		else if(rb>=d+ra) cout << -2 << endl;
		else if(d>ra+rb) cout << 0 << endl;
		else cout << 1 << endl;
	}
}

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

typedef pair<double,double>vec;

double norm(vec v1,vec v2){
    return (v1.first-v2.first)*(v1.first-v2.first)+(v1.second-v2.second)*(v1.second-v2.second);
}
int main()
{
    int n;
    cin>>n;
    while(n--){
        double x1,y1,r1,x2,y2,r2;
        cin>>x1>>y1>>r1>>x2>>y2>>r2;
        vec v1=make_pair(x1,y1);
        vec v2=make_pair(x2,y2);
        double dis=norm(v1,v2);
        if(dis-(r1+r2)*(r1+r2)>0)
            cout<<0<<endl;
        else if(dis-(r1-r2)*(r1-r2)>0&&dis-(r1+r2)*(r1+r2)<0){
            cout<<1<<endl;
        }
        else if((r1-r2)>0){
            cout<<2<<endl;
        }
        else if((r1-r2)<0)cout<<-2<<endl;
        else cout<<1<<endl;
    }
    return 0;
}

C++: #include <iostream>

int check_intersection(const double xa, const double ya, const double ra,
                            const double xb, const double yb, const double rb)
{
    double distance = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
    if(distance < (ra - rb) * (ra - rb)){
        if(ra > rb)
            return 2;
        else
            return -2;
    }
    else if(distance > (ra + rb) * (ra + rb))
        return 0;
    else return 1;
}

int main ()
{
    double xa, ya, ra, xb, yb, rb;
    u_int N;
    
    std::cin >> N;
    for(u_int i = 0; i < N; ++i){
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        std::cout << check_intersection(xa, ya, ra, xb, yb, rb) << std::endl;
    }
    
    return 0;
}