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<algorithm>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 2;

int main(){
    int n;
    cin >>n;
    REP(z, n){
        double x[N], y[N], r[N];
        REP(i, N) cin >>x[i] >>y[i] >>r[i];
        double d = sqrt((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]));
        if(r[0] + r[1] <= d) cout <<0 <<endl;
        else if(r[0] > r[1] && d <= r[0] - r[1]) cout <<2 <<endl;
        else if(r[1] > r[0] && d <= r[1] - r[0]) cout <<-2 <<endl;
        else cout <<1 <<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb;
  int n;
  cin >> n;
  while(n--){
    cin >>  xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(pow(xa - xb,2) + pow(ya - yb,2));
    if(d + rb < ra){
      cout << '2' << endl;
    }else if(d + ra < rb ){
      cout << '-2' << endl;
    }else if(ra + rb < d){
      cout << '0' << endl;
    }else cout << '1' << endl;
  }
  return 0;
}

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

inline double distance(double xa, double ya, double xb, double yb){
	return std::sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
}

int judge(std::vector<double> ve){
	double center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(ve[2] >= center_dis + ve[5]){
		return 2;
	}else if(ve[5] >= center_dis + ve[2]){
		return -2;
	}else{
		return 1;
	}
}

int main(void){
	int num;
	std::vector<double> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<cmath>
double xa,ya,ra,xb,yb,rb;
double dist(){
    return sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
        if(dist()+rb<ra) printf("2\n");
        else if(dist()+ra<rb) printf("-2\n");
        else if(dist()>ra+rb) printf("0\n");
        else printf("1\n");
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define repf(i, f, l) for(int i = f; i < (int)l; ++i)

#ifdef ONLINE_JUDGE
#define DEBUG false
#else
#define DEBUG true
#endif

#define pb emplace_back
#define lb lower_bound
#define ul unsigned long
#define ull unsigned long long
#define ll long long
#define INF 1000000007
#define MOD 1000000007
#define fs first
#define sd second

#define ALL(c) (c).begin(),(c).end()

#define DBG0(x)    {if(DEBUG){ cout << #x << ": " << x << "\t"; }}
#define DBG(x)     {if(DEBUG){DBG0(x); cout << endl;}}
#define DBG2(x, y) {if(DEBUG){DBG0(x); DBG(y);}}
#define DBG3(x, y, z) {if(DEBUG){DBG0(x); DBG2(y, z);}}
#define DBG4(w, x, y, z) {if(DEBUG){DBG0(w); DBG3(x, y, z);}}

template <class T>
ostream& operator<<(ostream& os, vector<T> xs){ for(T x: xs) os << x << ' '; return os; }
template <class S, class T>
ostream& operator<<(ostream& os, pair<S,T> st){ os << "(" << st.first << "," << st.second <<")"; return os; }

typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef vector<bool> vbl;
typedef pair<int, int> pii;

/* Library starts here */
const double EPS = 1.0e-14;
typedef complex<double> Point;
/* Line is represented as (a, b, c) of ax + by + c = 0 */
typedef tuple<double, double, double> Line;
const Point O(0.0,0.0);

istream& operator>>(istream& is, Point &pt){
    double a, b;
    is >> a >> b;
    pt.real(a); pt.imag(b);
    return is;
}

ostream& operator<<(ostream& os, const Point &pt){
    os << make_pair(pt.real(), pt.imag());
    return os;
}

ostream& operator<<(ostream& os, const Line &l){
    os << "(" << get<0>(l) << "," << get<1>(l) << "," << get<2>(l) << ")";
    return os;
}

inline double cross(const Point &a, const Point &b){
    return (a.real()*b.imag() - a.imag()*b.real());
}

inline double myarg(Point &a){
    double ret = arg(a);
    return (ret >= 0 ? ret : ret + 2*M_PI);
}

inline double signed_area(const Point &a, const Point &b, const Point &c){
    Point ab = b - a;
    Point ac = c - a;
    return cross(ab, ac) / 2.0;
}

inline bool intersect(const Point &a1, const Point &a2, const Point &b1, const Point &b2) {
  return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS) &&
          (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS));
}

void sort_by_arg(vector<Point> &pts){
    sort(pts.begin(), pts.end(), [](Point a, Point b){ return (myarg(a) < myarg(b)); });
}

/* bad */
double area(vector<Point> &vs){
    int n = vs.size();
    vector<Point> pts(n - 1);
    rep(i, n - 1) pts[i] = vs[i + 1] - vs[0];
    sort_by_arg(pts);
    double ans = 0.0;
    rep(i, n - 1) ans += cross(vs[i], vs[i + 1]);
    return ans / 2.0;
}

inline Line make_line(const Point &a, const Point &b){
    return make_tuple(a.imag() - b.imag() , b.real() - a.real(), -(a.imag() * b.real() - a.real() * b.imag()));
//  return make_tuple(a.imag() - b.imag() , b.real() - a.real(), a.imag() * b.real() - a.real() * b.imag());
}

inline Line orthogonal_line(const Line &l, const Point &p){
    return make_tuple(get<1>(l), -get<0>(l), get<0>(l) * p.imag() - get<1>(l) * p.real());
}

inline bool is_parallel(const Line &l0, const Line &l1){
    return ((get<0>(l0)*get<1>(l1) - get<1>(l0)*get<0>(l1)) == 0.0);
}

inline Point intersection_point(const Line &l0, const Line &l1){
    const double A = get<0>(l0);
    const double B = get<1>(l0);
    const double C = get<0>(l1);
    const double D = get<1>(l1);
    const double U = get<2>(l0);
    const double V = get<2>(l1);
    const double det = A*D - B*C;
    return Point((-D*U + B*V) / det,
                 ( U*C - A*V) / det);
}

inline Point rotate(const Point &p, const double theta){
    double ct = cos(theta);
    double st = sin(theta);
    return Point(ct * p.real() - st*p.imag(), st*p.real() + ct*p.imag());
}

/* End of the Library */
int main(void){
    int n;
    cin >> n;
    while(n-->0){
        Point pa, pb;
        double ra, rb;
        cin >> pa >> ra >> pb >> rb;
        const double AB = abs(pb - pa);
        /* A is in B */
        if(AB + rb < ra){
            cout << 2 << endl;
            continue;
        }
        if(AB + ra < rb){
            cout << -2 << endl;
            continue;
        }
        if(AB > ra + rb){
            cout << 0 << endl;
            continue;
        }
        cout << 1 << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>

using namespace std;

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