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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

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

using namespace std;

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


#define X real()
#define Y imag()
typedef complex<double> P;

int main(){
	  
	int n;
	cin>>n;
	rep(i,n){	
		double xa,ya,ra,xb,rb,yb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		
		P a = P(xa,ya);
		P b = P(xb,yb);
		
		double c = abs(a-b);
		
		if(abs(ra-rb)>c){
			if(ra>rb)puts("2");
			else puts("-2");
			continue;
		}
		if(ra+rb<c){
			puts("0");
			continue;
		}
		puts("1");
	}
	
}

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

float d(float x, float y, float z, float w){
	float ret;
	ret = pow(x - z, 2) + pow(y - w, 2);
	return sqrtf(ret);
}

int main(){
	int n,c;
	float x[2], y[2], r[2], dd;
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dd = d(x[0], y[0], x[1], y[1]);
		if(dd>r[0]+r[1]){
			cout << 0 << endl;
		}
		else{
			if(dd + r[0] <= r[1]){
				cout << -2 << endl;
			}
			else if (dd + r[1] <= r[0]) {
				cout << 2 << endl;
			}
			else {
				cout << 1 << endl;
			}

		}
	}
	return 0;
}

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

const double EPS = 1e-9;

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

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 dis = sqrt(pow((xa - xb), 2) - pow((ya - yb), 2));
    if(fabs(ra - rb) >= dis)
      if(ra > rb)
	cout << "2" << endl;
      else
	cout << "-2" << endl;
    else if(fabs(ra - rb) < dis && ra + rb > dis)
      cout << "1" << endl;
    else if(ra + rb > dis)
      cout << "0" << endl;
  }
}

C++: // AOJ 0023
#include<iostream>
#include<cmath>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const long double EPS = 1e-6;

long double sq(long double x) {
  return x * x;
}

long double abs(long double x) {
  return (x > 0 ? x : -x);
}
/*
bool eq(long double x, long double y) {
  return abs(x - y) < EPS;
}*/

long double dist(long double xa, long double ya, long double xb, long double yb) {
  return sq(xa - xb) + sq(ya - yb);
}

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

    long double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
//    cout << d << endl;
    
    if (ra - rb > d + EPS) {
      cout << 2 << endl;
    } else if (rb - ra > d + EPS) {
      cout << -2 << endl;
    } else if (d > ra + rb + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

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

struct circle {
	double x, y, r;
	circle(double x_ = 0.0, double y_ = 0.0, double r_ = 0.0):x(x_), y(y_), r(r_) {}
};

istream &operator>>(istream &is, circle &c) {
	return is >> c.x >> c.y >> c.r;
}

// Is b in a
bool in(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return a.r > b.r && d < a.r - b.r;
}

bool intersect(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return d < a.r + b.r && d > abs(a.r - b.r);
}

int solve() {
	circle a, b;
	cin >> a >> b;

	if(in(a, b)) return 2;
	if(in(b, a)) return -2;
	if(intersect(a, b)) return 1;
	return 0;
}

int main() {
	int t;
	cin >> t;

	while(t--) cout << solve() << endl;

	return EXIT_SUCCESS;
}

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

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

int main(){
    double xa, ya, ra, xb, yb, rb;
    int n;
    cin >> n;
    rep(i, n){
        int ans = 0;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        if(sqrt(pow(abs(xa-xb), 2)+pow(abs(ya-yb), 2))+rb < ra) ans = 2;
        else if(sqrt(pow(abs(xa-xb), 2)+pow(abs(ya-yb), 2))+ra < rb) ans = -2;
        else if(sqrt(pow(abs(xa-xb), 2)+pow(abs(ya-yb), 2)) <= ra+rb) ans = 1;
        else ans = 0;
        cout << ans << endl;
    }
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

double len(double xa, double ya, double xb, double yb) {
	double ans = 0;
	ans = sqrt(pow((xa - xb), 2) + pow((ya - yb), 2));
	return ans;
}

int main() {
	lint N;
	cin >> N;
	double xa, ya, ra, xb, yb, rb;
	rep(i, N) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (len(xa, ya, xb, yb) + ra < rb) {
			cout << -2 << endl;
		}
		else if (len(xa, ya, xb, yb) + rb < ra) {
			cout << 2 << endl;
		}
		else if (len(xa, ya, xb, yb) > ra + rb) {
			cout << 0 << enld;
		}
		else {
			cout << 1 << endl;
		}
	}
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    int n;
    cin >> n;
    rep(i, 0, n){
        int ans;
        double x[2], y[2], r[2];
        rep(j, 0, 2) cin >> x[j] >> y[j] >> r[j];
        double d = sqrt(pow(x[0] - x[1], 2) + pow(y[0] - y[1], 2));
        if(r[0] + r[1] < d) ans = 0;
        else if(r[0] > d + r[1]) ans = 2;
        else if(r[1] > d + r[0]) ans = -2;
        else if(fabs(r[0] + r[1] - d) < 1e-10) ans = 1;        
        cout << ans << endl;
    }
}

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

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