Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var xa, ya, ra, xb, yb, rb float64
		fmt.Scan(&xa, &ya, &ra, &xb, &yb, &rb)
		// println(xa, ya, ra, xb, yb, rb)
		dis := math.Sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
		if dis + ra < rb {
			fmt.Println(-2)
		} else if dis + rb < ra {
			fmt.Println(2)
		} else if dis > rb + ra {
			fmt.Println(0)
		} else {
			fmt.Println(1)
		}
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define MAX_N 5001
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<string, ll> PS;
typedef vector<ll> V;

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


double xa, ya, ra, xb, yb, rb, d;
ll n;

int main(){
	cin >> n;
	REP(i, n){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		if (xa == xb&&ya == yb) d = 0;
		else d = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));

		if (ra + rb < d)cout << 0 << endl;
		else if (d + ra < rb)cout << -2 << endl;
		else if (d + rb < ra)cout << 2 << endl;
		else cout << 1 << endl;
	}
}

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