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

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 a.x*a.x+a.y*a.y;
}
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<EPS) return 2;
  if(d1+a.r-b.r<EPS) return -2;
  if(d1-d2<=EPS) 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 <iostream>
#include <cmath>
using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;

	while(n > 0){
		double xa, ya, ra;
		double xb, yb, rb;

		cin >> xa >> ya >> ra;
		cin >> xb >> yb >> rb;

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

		if(d > ra + rb) cout << 0 << endl;
		else if(ra > rb && d < ra - rb) cout << 2 << endl;
		else if(rb > ra && d < rb - ra) cout << -2 << endl;
		else cout << 1 << endl;
		--n;
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
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 ab = sqrt(pow(xa-xb, 2.0) + pow(ya-yb, 2.0));
 
        if(ab > ra + rb)
            cout << 0 << endl;
        else if(ab >= fabs(ra - rb))
            cout << 1 << endl;
        else if(ra > rb)
            cout << 2 << endl;
        else
            cout << -2 << endl;
    }
    return 0;
}

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

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

C++: #define _USE_MATH_DEFINES
 
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>

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

	return 0;
}

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

int main(){
	int n;cin >> n;
	double x1, y1, r1, x2, y2, r2;
	while(n--){
		cin >>x1>>y1>>r1>>x2>>y2>>r2;
		double d = pow(y2-y1, 2)+pow(x2-x1, 2);
		d = sqrt(d);
		if(r1 + r2 >= d){
			int f = 0;
			if(d < r1){
				if(d+r1 <= r2)cout << -2 << endl;
				f = 1;
			}
			if(d < r2){
				if(d+r2 <= r1)cout << 2 << endl;
				f = 1;
			}
			if(!f)cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
		//cout << d << 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 a.x*a.x+a.y*a.y;
}
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<EPS) return 2;
  if(d1+a.r-b.r<EPS) return -2;
  if(d1-d2>EPS) return 0;
  return 1;
}
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 <iostream>
#include <cmath>
#include <cstdlib>

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 dsq = pow( xb - xa, 2.0 ) + pow( yb - ya, 2.0 );
    if( sqrt( dsq ) > ra + rb ) {
      cout << 0 << endl;
      continue;
    }
//     b in a
    if( sqrt( dsq ) < ra - rb ) {
      cout << 2 << endl;
      continue;
    }

//     a in b 
    if( sqrt( dsq ) < rb - ra ) {
      cout << -2 << endl;
      continue;
    }

    cout << 1 << endl;
  }

  return EXIT_SUCCESS;
}

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-14;

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));
    
    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++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>

using namespace std;

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

int main(){
	int t;
	cin>>t;
	while(t--){
		double xa,ya,ra,xb,yb,rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double len = sqrt(sq(xa-xb)+sq(ya-yb));
		if(len + rb <= ra)
			puts("2");
		else if(len + ra <= rb)
			puts("-2");
		else if(len <= ra + rb)
			puts("1");
		else 
			puts("0");
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb;
  int n;
  cin >> n;
  while(n--){
    cin >>  xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(pow(xa - xb,2) + pow(ya - yb,2));
    if(d>ra+rb)cout<<0<<endl;
    else if(ra-rb>d)cout<<2<<endl;
    else if(rb-ra>d)cout<<-2<<endl;
    else cout<<1<<endl;

  }
  return 0;
}