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 <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n = 0;
	std::vector<int> a;
	double xa, ya, ra, xb, yb, rb;

#if INPUT_FROM_FILE
	//std::ifstream ifs("test.txt");
	FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	fscanf(fp, "%d", &n);
#else
	scanf("%d", &n);
#endif
	
	for(int i = 0; i < n; i++){
#if INPUT_FROM_FILE
		fscanf(fp, "%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
#else
		scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
#endif

		double d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));

		if(d > ra + rb){
			std::cout << 0 << std::endl;
		}
		else if(d + rb < ra){
			std::cout << 2 << std::endl;
		}
		else if(d + ra < rb){
			std::cout << -2 << std::endl;
		}
		else{
			std::cout << 1 << std::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>
#include <deque>

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

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) number.push_back(0);
		//"2" if B is in A
		else if(dis + rb <= ra) number.push_back(2);
		//"-2" if A is in B
		else if(dis + ra <= rb) number.push_back(-2);
		//"1" if circumference of A and B intersect
		else number.push_back(1);
	}
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	return 0;
	}

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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya -yb);
		float d = abs(comp);
		float r = ra + rb;
		if(d <= r){
			if(d < ra && rb < ra){
				cout << 2 << endl;
			}
			else if(d < rb && ra < rb){
				cout << -2 << endl;
			}
			else{
				cout << 1 << endl;
			}
		}
		if(d > r){
			cout << 0 << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

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

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

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

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

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

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

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) number.push_back( 0 );
		//"2" if B is in A
		else if(ra > rb && dis + rb <= ra) number.push_back( 2 );
		//"-2" if A is in B,
		else if(rb > ra && dis + ra <= rb) number.push_back( -2 );
		//"1" if circumference of A and B intersect
		else number.push_back( 1 );
	}
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	return 0;
	}

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

using namespace std;

int Calculate(double, double, double, double, double, double);
double GetDistance(double, double, double, double);

int main(){
  int i, n;
  double xa, ya, ra, xb, yb, rb;

  cin >> n;
  for(i=0; i<n; ++i){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    cout << Calculate(xa, ya, ra, xb, yb, rb) << endl;
  }
  return 0;
}

int Calculate(double xa, double ya, double ra,
	      double xb, double yb, double rb){
  double r;
  r = GetDistance(xa, ya, xb, yb);
  if(ra > rb && ra > r + rb) return 2;
  if(ra < rb && rb > r + ra) return -2;
  if(r <= ra + rb) return 1;
  return 0;
}

double GetDistance(double xa, double ya, double xb, double yb){
  double x, y;
  x = xa - xb;
  y = ya - yb;
  return sqrt(x*x + y*y);
}

C++: #include <iostream>
#include <math.h>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(r1+r2 <= u){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		double d = abs(ax-bx)*abs(ax-bx) + abs(ay-by)*abs(ay-by);
		d = sqrt(d);
		//printf("%f\n", d);
		if (d > ra+rb) puts("0");
		else if (d==0) {
			if (ra > rb) puts("2");
			else puts("-2");
		}
		else {
			// cross type
			if (d > ra && d > rb) puts("1");
			// inner type
			else if (d < ra && d > rb) puts("2");
			else if (d > ra && d < rb) puts("-2	");
		}
	}
	return 0;
}