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 <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

int main(){
    int n;
    cin >> n;
    REP(i, n){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double dist;
        dist = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        if (dist > ra + rb) cout << "0" << endl;
        else {
            if (ra > rb){
                if (dist+rb < ra) cout << "2" << endl;
                else cout << "1" << endl;
            } else {
                if (dist+ra < rb) cout << "-2" << endl;
                else cout << "1" << endl;
            }
        }
    }
}

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

const double DIFF = 0.0000001;

int main() {
    int n;
    cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double dist2 = pow(xa - xb, 2) + pow(ya - yb, 2),
            radiusSum2 = pow(ra + rb, 2);
        int res;
        if (dist2 > radiusSum2) {
            res = 0;
        } else if (fabs(dist2 - radiusSum2) < DIFF){
            res = 1;
        } else if (ra < rb) {
            res = -2;
        } else {
            res = 2;
        }
        cout << res << endl;
    }
}

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

int solve(long double d,long double ra,long double rb){
  if(ra+rb<d){
    return 0;
  }else if(ra+rb==d){
    return 1;
  }else if(ra+d<rb){
    return -2;
  }else if(rb+d<ra){
    return 2;
  }else{
    assert(0);
  }
  return -100;
} 
int main(){
  int xa,xb,ya,yb,ra,rb;
  int n;
  cin>>n; 
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    cout<<solve(sqrt(pow(ya-yb,2)+pow(xa-xb,2)),ra,rb)<<endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;

struct Point{
	double x, y, r;
}A, B;

int main(void)
{
	int T;
	cin >> T;

	for(int i = 0; i < T; i++){
		cin >> A.x >> A.y >> A.r >> B.x >> B.y >> B.r;

		double dis = sqrt(pow(A.x - B.x, 2) + pow(A.y - B.y, 2));

		if(dis < A.r - B.r)
			cout << 2 << endl;
		else if(dis < B.r - A.r)
			cout << -2 << endl;
		else if(dis == A.r + B.r)
			cout << 1 << endl;
		else if(dis > A.r + B.r)
			cout << 0 << endl;
	}

	return 0;
}

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

int state_circles(const std::vector<double> &a, const std::vector<double> &b){
	double d;
	d = sqrt(pow(a[0] - b[0], 2) + pow(a[1] - b[1], 2));
	if((a[2] + b[2]) < d)
		return 0;
		if(std::abs(a[2] - b[2]) > d){
		if(a[2] > b[2])
			return 2;
		else 
			return -2;
	}
	
	else 
		return 1;
}

int main(){
	std::vector<double> a(3), b(3);
	int data_num;
	std::cin >> data_num;
	for(int i = 0; i < data_num; ++i){ 
		std::cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];
		std::cout << state_circles(a, b) << std::endl;
	}
	
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <functional>
#include <complex>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
const double PI = 3.141592653589793238462643383279502884L;
const int LARGE_PRIME = 1000000007;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repfn(i,a,cont,next) \
  for(auto i = (a); [=](){return(cont);}(); i = [=](){return(next);}())
#define repby(i,a,b,s) repfn(i,a,i<b,i+s)
#define repab(i,a,b) repby(i,a,b,1)
#define rep(i,b) repab(i,0,b)
#define pb push_back
#define sz(c) int((c).size())

typedef complex<double> P;

int main(int argc, char **argv)
{
  int N, a=0, b=1;
  vector<double> x(2), y(2), r(2);
  cin >> N;
  while (N--) {
    for (auto i:{a, b}) {
      cin >> x[i] >> y[i] >> r[i];
    }

    P A(x[a], y[a]), B(x[b], y[b]);

    double d = abs(A - B);
    if (d <= r[a] + r[b]) {
      if (d + r[a] <= r[b]) {
        cout << -2;
      } else if (d + r[b] <= r[a]) {
        cout << 2;
      } else {
        cout << 1;
      }
    } else {
      cout << 0;
    }
    cout << endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>
#include <complex>

using namespace std;

static const double EPS=1e-12;
static const double INF=1e24;
static const double PI=3.141592653589793;

using Point=complex<double>;
using Plane=vector<Point>;

namespace std {
    bool operator<(const Point &a, const Point &b) {
        return real(a)!=real(b)? real(a)<real(b) : imag(a)<imag(b);
    }
}

double cross_prod(const Point &a, const Point &b) {
    return imag(conj(a)*b);
}

double dot_prod(const Point &a, const Point &b) {
    return real(conj(a)*b);
}

struct Circle {
    Point p;
    double r;
    Circle() {}
    Circle(const Point &p, const double r): p(p), r(r) {}
};

size_t num_ctangent(const Circle &c1, const Circle &c2) {
    double d=abs(c1.p-c2.p);
    double r=min(c1.r, c2.r), R=max(c1.r, c2.r);
    if (R+r < d) {
        return 4;
    } else if (abs(R+r-d) < EPS) {
        return 3;
    } else if (abs(R-r-d) < EPS) {
        return 1;
    } else if (R-r > d) {
        return 0;
    } else {
        return 2;
    }
}

bool testcase_ends() {
    double x, y, r;
    if (scanf("%lf %lf %lf", &x, &y, &r) == EOF) return 1;

    Circle A(Point(x, y), r);
    scanf("%lf %lf %lf", &x, &y, &r);
    Circle B(Point(x, y), r);

    size_t n=num_ctangent(A, B);
    if (n == 0) {
        printf("%d\n", A.r>B.r? 2:-2);
    } else {
        printf("%d\n", n!=4);
    }

    return 0;
}

int main() {
    int n;
    scanf("%d", &n);

    for (int i=0; i<n; ++i)
        if (testcase_ends())
            return 1;

    return 0;
}