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 <cstdio>
#include <cmath>

using namespace std;

int main(void){
	int n, i;
	double xa, ya, ra, xb, yb, rb;
	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		if(sqrt(pow(xb - xa,2.0) + pow(yb - ya,2.0)) + rb <= ra){
			printf("2\n");
		}else if(sqrt(pow(xb - xa,2.0) + pow(yb - ya,2.0)) + ra <= rb){
			printf("-2\n");
		}else if(sqrt(pow(xb - xa,2.0) + pow(yb - ya,2.0)) <= ra + rb){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<functional>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<deque>
#include<sstream>
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<bitset>
#include<time.h>
#include<cstdlib>
#include<cassert>
#define ll long long
using namespace std;
                   
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout<<fixed;
#ifdef LOCAL_DEFINE
    freopen("in", "r", stdin); 
    freopen("out","w",stdout);
#endif
  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 d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    if(d>ra+rb){
      cout<<0<<"\n";
    }else if(abs(ra-rb)<=d && ra+rb>=d){
      cout<<1<<"\n";
    }else{
      cout<<(ra>rb?"":"-")<<2<<"\n";
    }
  }
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}

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

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        double xa, ya, ra;
        double xb, yb, rb;
        double d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); // distance of o1 and o2
        
        if (d > ra + rb)
        {
            cout << "0" << endl;
        }
        else if (d >= fabs(ra - rb)) // && ra + rb >= d
        {
            cout << "1" << endl;
        }
        else if (ra > rb) // d < ra - rb
        {
            cout << "2" << endl;
        }
        else
        {
            cout << "-2" << endl;
        }
    }
}

int main()
{
    Solution();
    return 0;
}

C++: #include <iostream>
//#include <algorithm>
#include "math.h"

using namespace std;

int main(){
	int count;
	double xa,ya,ra,xb,yb,rb;
	cin >> count;
	for(int i=0;i<count;i++){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dist = pow((xa-xb)*(xa-xb)+(xa-xb)*(xa-xb),0.5);
		//		double dist = (xa-xb)*(xa-xb)+(xa-xb)*(xa-xb);
		//cout << dist << endl;
		if(dist>ra+rb){
			cout << 0 << endl;
		}
		else if(dist > ra - rb && dist > rb - ra){
			cout << 1 << endl;
		}
		else if(ra>rb){
			cout << 2 << endl;
		}
		else{
			cout << -2 << endl;
		}
	}
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r = pow(pow(xb - xa, (float)2.0) + pow(yb - ya, (float)2.0), (float)1.0/2);
		if (r > ra + rb) {
			cout << 0 << endl;
		}
		else if (r <= ra + rb) {
			if (ra >= rb) {
				if (r < ra - rb) {
					cout << 2 << endl;
				}
				else if (r > ra - rb) {
					cout << 1 << endl;
				}
			}
			else if (ra < rb) {
				if (r <rb - ra) {
					cout << -2 << endl;
				}
				else if (r > rb - ra) {
					cout << 1 << endl;
				}
			}
		}
	}
	return 0;
}

C++: // class point	の練習（クラスの高度な実装）
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <vector>
#include <queue>


typedef long long llong;
using namespace std;

#define SMALL_LIMIT 1e-30

struct Point {
	double x;
	double y;
};
double dist(Point a, Point b) {
	return sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y));
}

int main() {
	int n;
	Point a, b;
	double ra, rb;
	double d;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.x >> a.y >> ra >> b.x >> b.y >> rb;
		d = dist(a, b);
		if (d + rb -ra< 0)cout << 2 << endl;
		else if (d + ra-rb <0)cout << -2 << endl;
		else if (0 >-d+ ra + rb)cout << 0 << endl;
		else cout << 1 << endl;

	}
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const double INF = 1e12;


int main(){
	int n;
	cin>>n;
	long double xa,ya,ra,xb,yb,rb;
	REP(i,n){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		long double d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if(d<ra-rb){
			cout<<"2"<<endl;
		}else if(d<rb-ra){
			cout<<"-2"<<endl;
		}else if(d2<(ra+rb)){
			cout<<"1"<<endl;
		}else{
			cout<<"0"<<endl;
		}
	}
	return 0;
}
/*
2
0.0 0.0 5.0 0.0 0.0 4.0
0.0 0.0 3.0 4.1 0.0 2.0
*/

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

int main() {
	int n; scanf("%d", &n);
	rep(i, n) {
		double x1, y1, r1, x2, y2, r2;
		scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &r1, &x2, &y2, &r2);
		double d = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
		if (d > r1 + r2)puts("0");
		else if (r1 * 2 - d >= r2 * 2)puts("2");
		else if (r2 * 2 - d >= r1 * 2)puts("-2");
		else puts("1");
	}
}