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>

inline double calcDistance(double x, double y){
	return hypot(x, y);
}

int main(){
	int num;
	std::cin >> num;
	
	for(int i = 0; i < num; ++i){
		double xa, xb, ya, yb, ra, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = calcDistance(xa - xb, ya - yb);
		
		int answer = 1;
		if(ra + rb < d) //重なっていないとき
			answer = 0;
		else if(ra - rb > d) //BがAの中にあるとき
			answer = 2;
		else if(rb - ra > d) //AがBの中にあるとき
			answer = -2;
		std::cout << answer << std::endl;
	}
}

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

typedef pair<double,double>vec;

double norm(vec v1,vec v2){
    return (v1.first-v2.first)*(v1.first-v2.first)+(v1.second-v2.second)*(v1.second-v2.second);
}
int main()
{
    int n;
    cin>>n;
    while(n--){
        double x1,y1,r1,x2,y2,r2;
        cin>>x1>>y1>>r1>>x2>>y2>>r2;
        vec v1=make_pair(x1,y1);
        vec v2=make_pair(x2,y2);
        double dis=norm(v1,v2);
        if(dis-(r1+r2)*(r1+r2)>0)
            cout<<0<<endl;
        else if(dis-(r1-r2)*(r1-r2)>=0&&dis-(r1+r2)*(r1+r2)<0){
            cout<<1<<endl;
        }
        else if((r1-r2)>0){
            cout<<2<<endl;
        }
        else cout<<-2<<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( 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++: #include <iostream>
#include <cmath>

struct Circle {
    const double x, y, r;
    Circle(const double x, const double y, const double r)
        :x(x), y(y), r(r) {};
    ~Circle() = default;
    bool include(Circle &C);
};

inline double distance(Circle &A, Circle &B) {
    return std::sqrt((A.x - B.x)*(A.x - B.x) + (A.y - B.y)*(A.y - B.y));
}

bool Circle::include(Circle &C) {
    auto d = distance(*this, C);
    return (d*d < (r - C.r)*(r - C.r) && r > C.r);
}

int circles_intersection(Circle &A, Circle &B) {
    if (distance(A, B) > A.r + B.r)
        return 0;
    else if (A.include(B))
        return 2;
    else if (B.include(A))
        return -2;
    else
        return 1;
}

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

    std::cin >> n;
    for (u_int i = 0; i < n; ++i) {
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        Circle A(xa, ya, ra), B(xb, yb, rb);
        std::cout << circles_intersection(A, B) << std::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(abs(xa-xb)*abs(xa-xb)+abs(ya-yb)*abs(ya-yb));
		if(d+rb<ra){
			cout<<2<<endl;
		}else if(d+ra<rb){
			cout<<-2<<endl;
		}else if(d>(ra+rb)){
			cout<<0<<endl;
		}else{
			cout<<1<<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 <iostream>
#include <cmath>
#include <cstdio>
#include <complex>

using namespace std;

typedef complex<double> P;

int main(void){
  int n; cin >> n;
  while(n--){
    double ra, rb;
    P a,b;
    cin  >> a.real() >> a.imag() >> ra >> a.real() >> b.imag() >> rb;
    double d = abs(a-b);
    int ans;
    if(0){}
    else if(d + rb < ra) ans = 2;
    else if(d + ra < rb) ans = -2;
    else if(d > ra + rb) ans = 0;
    else ans = 1;
    cout << ans << endl;
  }
  return 0;
}

C++: // AOJ 0023
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const long double EPS = 1e-8;

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

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