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;

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 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 ( d<=ra+rb)
			cout<<1<<endl;
		else
			cout<<0<<endl;
	}
	return 0;
}

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

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

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 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 ( d<=ra+rb)
			cout<<1<<endl;
		else
			cout<<0<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
#define equals(a,b) (fabs((a) - (b)) < EPS)
class Point{
public:
  double x,y;
  Point(double x = 0, double y = 0):x(x), y(y) {}
  Point operator + (Point p){
    return Point(x+p.x,y+p.y);
  }
  Point operator - (Point p){
    return Point(x-p.x,y-p.y);
  }
  Point operator * (double k){
    return Point(x*k,y*k);
  }
  Point operator / (double k){
    return Point(x/k,y/k);
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
typedef Point Vector;
double norm(Vector a){
  return pow(a.x,2.0)+pow(a.y,2.0);
}
double abs(Vector a){
  return sqrt(norm(a));
}
class Circle{
public:
  Point c;
  double r;
  Circle(Point c = Point(),double r = 0.0):c(c),r(r){}
};
int check(Circle a,Circle b){
  double d1 = abs(b.c-a.c) , d2 = (a.r+b.r);
  
  if(d1+b.r-a.r<0) return 2;
  if(d1+a.r-b.r<0) return -2;
  if(d1-d2<0) return 1;
  return 0;
}
int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    Point a,b;
    double r1,r2;
    cin >> a.x >> a.y >> r1 >> b.x >> b.y >> r2;
    Circle c1(a,r1),c2(b,r2);
    cout << check(c1,c2) << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<short, short> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 100000007;
const double EPS = 1e-10;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

double ax, ay, ar, bx, by, br;
double d;
int main()
{
	int n; cin >> n;
	REP(i, n)
	{
		cin >> ax >> ay >> ar >> bx >> by >> br;
		d = abs(ax - bx)*abs(ax - bx) + abs(ay - by)*abs(ay - by);
		int ans;
		if (d > (ar + br)*(ar + br)) ans = 0;
		else if (ar > br && (ar - sqrt(d)) > br) ans = 2;
		else if (ar < br && (br - sqrt(d)) > ar) ans = -2;
		else ans = 1;
		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

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

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;
typedef pair<int,int> pii;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

double EPS = 1e-10;
double add(double a, double b){
  if(abs(a+b) < EPS* (abs(a) + abs(b))) return 0;
  return a+b;
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  double xa,ya,xb,yb,ra,rb;
  cin >> N;
  rep(i,N){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(add(xa,-xb)*add(xa,-xb) + add(ya,-yb)*add(ya,-yb));
    if(d>ra+rb){
      cout << 0 << endl;
    }
    else if(d<max(ra,rb)-min(ra,rb)){
      if(ra>rb){
        cout << 2 << endl;
      }
      else{
        cout << -2 << endl;
      }
    }
    else if(d<=ra+rb)cout<<1<<endl;
  }
  return 0;
}