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 <cmath>

using namespace std;

inline double sq (double a) {
    return a * a;
}

inline double dist (double x1, double y1, double x2, double y2) {
    return sqrt(sq(x1 - x2) + sq(y1 - y2));
}

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa;
        cin >> ya;
        cin >> ra;
        cin >> xb;
        cin >> yb;
        cin >> rb;
        double d = dist(xa, ya, xb, yb);
        int s;
        if (d + rb <= ra) s = 2;
        else if (d + ra <= rb) s = -2;
        else if (d <= ra + rb) s = 1;
        else s = 0;
        cout << s << endl;
    }
    return 0;
}

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

int main() {
	int n;
	double x_a, y_a, r_a, x_b, y_b, r_b;
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> x_a >> y_a >> r_a >> x_b >> y_b >> r_b;
		double distance2 = (x_a - x_b)*(x_a - x_b) + (y_a - y_b)*(y_a - y_b);

		if (distance2 > (r_a + r_b)*(r_a + r_b)) {
			cout << 0 << endl;
		} else if (distance2 > (r_a - r_b)* (r_a - r_b)){
			cout << 1 << endl;
		} else if(r_a > r_b){
			cout << 2 << endl;
		} else {
			cout << -2 << endl;
		}
	}


	return 0;
}

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

int main()
{
    int n;
    double x1, y1, r1, x2, y2, r2;

    cin >> n;

    while( n-- )
    {
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2 ;

        double dis = sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) );
        if( dis > r1 + r2 )
            cout << 0 << endl;
        else if( r1 > dis + r2 )
            cout << 2 << endl;
        else if( r2 > dis + r1 )
            cout << -2 << endl;
        else
            cout << 1 << endl;
    }
    return 0;
}

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

int main() {
    int n;
    cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
        double sr = (ra + rb) * (ra + rb);
        double dr = (ra - rb) * (ra - rb);

        int res = 1;
        if (sr < d) {
            res = 0;
        } else if (d < dr) {
            res = (ra > rb) ? 2 : -2;
        }
        cout << res << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)

int main(void){
    int n;
    double x[2], y[2], r[2];
    cin >> n;
    rep(data, n) {
        rep(i, 2) cin >> x[i] >> y[i] >> r[i];
        double dist = sqrt(pow(y[1]-y[0], 2.0) + pow(x[1]-x[0], 2.0));

        if(r[0] > r[1] && dist < r[0]-r[1]) cout << 2 << endl;
        else if(r[1] > r[0] && dist < r[1]-r[0]) cout << -2 << endl;
        else if(dist > r[0] + r[1]) cout << 0 << endl;
        else cout << 1 << endl;
    }
}

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


using namespace std;

int main(){
  int datasets = 0;
  cin >> datasets;

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

    //dis
    double dis = sqrt(pow(xa-xb, 2) + pow(ya-yb,2));
    
    if(abs(ra+rb) < dis){
      cout << 0 << endl;
      continue;
    }

    if(ra-rb > dis){
      cout << 2 << endl;
      continue;
    }

    if(rb-ra > dis){
      cout << -2 << endl;
      continue;
    }

    if(ra+rb > dis){
      cout << 1 << endl;
      continue;
    }
  }
}

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(dist(xa, ya, xb, 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 <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

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 dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist){
			cout<<0<<endl;
		}
		// SÔ£ª
		else if(!EQ(abs(ra-rb)*abs(ra-rb),dist)&&(abs(ra-rb))*(abs(ra-rb))<dist){
			cout<<1<<endl;
		}
		else{
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb){
				cout<<2<<endl;
			}
			else
				cout<<-2<<endl;
		}
	}


	return 0;
}

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

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

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 dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist)
			cout<<0<<endl;
		// ~üªðíé
		else if(EQ(abs(ra-rb)*abs(ra-rb),dist)||(abs(ra-rb))*(abs(ra-rb))<dist||EQ((ra+rb)*(ra+rb),dist))
			cout<<1<<endl;
		else if(abs(ra-rb)*abs(ra-rb)>dist){
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
		}
		else
			cout<<1<<endl;
	}

	return 0;
}

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

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 if (xa == xb) d = abs(ya - yb);
		else if (ya == yb) d = abs(xa - xb);
		else d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
		if (d <= abs(ra - rb)){
			if (ra > rb){
				cout << 2 << endl;
			}
			else{
				cout << -2 << endl;
			}
			continue;
		}
		if (d <= ra + rb){
			cout << 1 << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
}