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;
  
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
  
typedef long long ll;
typedef pair<int, int> ii;
 
#define EPS 1e-8
 
int main(){
     
        int n;
        cin >> n;
        while(n--){
                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(d > ra + rb) cout << 0 << endl;
                else if(d < fabs(ra - rb)){
                        if(ra > rb) cout << 2 << endl;
                        else cout << -2 << endl;
                    }
                else cout << 1 << endl;
            }
        return 0;
}

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

int main(){
    int n;

    cin >> n;

    for(int i=1; i<=n; i++){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));

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

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