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 <list>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#define rep(i, n) for(int i = 0; i < n; i ++)
#define COUNT(i, n) for(int i = 1; i <= n; i ++)
#define ITER(c) __typeof((c).begin())
#define each(c, it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define ALL(c) c.begin(), c.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;

int main(void){
    int n; cin >> n;

    for(double xa, ya, ra, xb, yb, rb, d; n -- && cin >> xa >> ya >> ra >> xb >> yb >> rb; cout << ((ra + rb < d) ? 0:(d < rb - ra && ra < rb) ? -2:(d < ra - rb && rb < ra) ? 2:1) << endl)
        d = sqrt(pow(xb - xa, 2) + pow(yb - ya, 2));

    return 0;
}

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

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 long long LL;
typedef unsigned long long ULL;

//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(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

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

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   int n;
   double x[2],y[2],r[2];
   cin>>n;
   REP(i,n){
      REP(j,2) cin >> x[j] >> y[j] >> r[j];
      if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))>r[1]+r[0])
         cout << "0" << endl;
      else if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))<r[0])
         cout << "2" << endl;
      else if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))<r[1])
         cout << "-2" << endl;
      else cout << "1" << endl;
   }
}

C++: #include <iostream>

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 = (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 <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;

double tb(double n){
	return n * n;
}
int main(void){

int nm,ans;
double xa,ya,ra,xb,yb,rb;
	while(cin >> nm){
		
//		if(nm == 0) break;
		rep(i,nm){
			cin >> xa >> ya >> ra;
			cin >> xb >> yb >> rb;
			
			if(tb(xa-xb) + tb(ya-yb) > tb(ra+rb)) ans = 0;
			else if(tb(rb) + tb(xa-xb) + tb(ya-yb) < tb(ra)) ans = 2;
			else if(tb(ra) + tb(xa-xb) + tb(ya-yb) < tb(rb)) ans = -2;
			else ans = 1;
			cout << ans << endl;
		}
	}
	return 0;
}

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

const double eps = 1e-10;

int main(void){
	int n;
	scanf("%d", &n);
	
	for(int i = 0; i < n; i++){
		double ax, ay, ar, bx, by, br;
		scanf("%lf %lf %lf %lf %lf %lf", &ax, &ay, &ar, &bx, &by, &br);
		double x = pow(ax-bx,2);
		double y = pow(ay-by,2);
		double d = sqrt(x+y);
		
		if(d>ar+br){
			puts("0");
		}else if(ar+d < br){
			puts("-2");
		}else if(br+d < ar){
			puts("2");
		}else{
			puts("1");
		}
	}
	
	return 0;
}

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

int main(void) {
    double xa, ya, ra, xb, yb, rb;
    double distance;
    int answer;
    int n;
    
    cin >> n;
    for(int i = 0; i < n; ++i) {
        scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
        distance = (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb);
        
        if(distance > (ra + rb)*(ra + rb)) {
            answer = 0;
        } else if((ra - rb)*(ra - rb) <= distance && distance <= (ra + rb)*(ra + rb)) {
            answer = 1;
        } else if(ra > rb) {
            answer = 2;
        } else if(ra < rb) {
            answer = -2;
        }
        cout << answer << endl;
    }
}

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = hypot(xa - xb, ya - yb);
		if (d < abs(ra - rb))
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
		else if (d <= ra + rb)
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 0 << std::endl;
		}
	}
	return 0;
}