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 <cstdio>
#include <cmath>
#include <complex>
using namespace std;

typedef complex<double> Point;

#define X real()
#define Y imag()

int n;
Point ps[2];
double rs[2];

int main() {
  scanf("%d", &n);
  while (n--) {
    for (int i=0; i<2; i++) {
      double x, y;
      scanf("%lf%lf%lf", &x, &y, &rs[i]);
      ps[i] = Point(x, y);
    }

    Point dp = ps[0]-ps[1];
    double d = sqrt(dp.X*dp.X+dp.Y*dp.Y);
    if (d > rs[0]+rs[1]) puts("0");
    else if (rs[1] >= rs[0] + d) puts("-2");
    else if (rs[0] >= rs[1] + d) puts("2");
    else puts("1");
  }
}

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 > ra + rb)
		{
			std::cout << 0 << std::endl;
		}
		else if (d == ra + rb || d > abs(ra - rb))
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
	}
	return 0;
}

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

int solve(double xa, double ya, double ra, double xb, double yb, double rb){
    double distance = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
    if (distance > ra + rb) return 0;
    else if (distance < ra - rb) return 2;
    else if (distance < rb - ra) return -2;
    else return 1;
}

int main(){
    double xa, ya, ra, xb, yb, rb;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
	cin >> xa >> ya >> ra >> xb >> yb >> rb;
	cout << solve(xa, ya, ra, xb, yb, rb);
    }
}

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

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        double xa, ya, ra;
        double xb, yb, rb;
        double d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); // distance of o1 and o2
        
        if ((d <= ra - rb) && (ra > rb))
        {
            cout<<"2"<<endl;
        }
        
        if ((d <= rb - ra) && (ra < rb))
        {
            cout<<"-2"<<endl;
        }
        
        if (d > abs(ra - rb) && (d <= ra + rb))
        {
            cout<<"1"<<endl;
        }
        
        if (d > ra + rb)
        {
            cout<<"0"<<endl;
        }

    }
}

int main()
{
    Solution();
    return 0;
}

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

int main(){
	int N;
	std::cin >> N;
	
	std::array<int, 20> ans;
	
	for(int i=0; i<N; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		double d = pow((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb), 0.5);
		
		if(ra > rb && d < ra-rb) ans[i] = 2;
		else if(rb > ra && d < rb-ra) ans[i] = -2;
		else if(d <= ra+rb) ans[i] = 1;
		else if(d > ra+rb) ans[i] = 0;
	}
	
	for(int i=0; i<N; ++i)
		std::cout << ans[i] << std::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 ax,ay,ar,bx,by,br;
		cin >> ax >> ay >> ar >> bx >> by >> br;
		double d = sqrt((ax-bx)*(ax-bx) + (ay-by)*(ay-by)); 
		if (ar > br && ar-d >= br)
			cout << 2 << endl;
		else if (br > ar && br-d >= ar)
			cout << -2 << endl;
		else if (d <= ar+br)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

C++: /*AOJ 0023*/

#include<iostream>
#include<vector>
#include<math.h>

using namespace std;

class Circle_obj{
public:
	double x,y,r;
};

int isCircleToCircle(Circle_obj a,Circle_obj b){

	double tmpX = a.x - b.x;
	double tmpY = a.y - b.y;

	double R = sqrt(tmpX*tmpX + tmpY*tmpY);

	if(a.r >= b.r){
		if( R + b.r < a.r){
			return 2;
		}
	}
	else{
		if( R + a.r < b.r ){
			return -2;
		}
	}

	if( R <= a.r + b.r){
		return 1;
	}
	else{
		return 0;
	}
}

int main(){

	int n;

	cin>>n;

	Circle_obj a,b;

	vector<int> data;

	for(int i=0;i<n;i++){
		cin>>a.x;
		cin>>a.y;
		cin>>a.r;
		cin>>b.x;
		cin>>b.y;
		cin>>b.r;

		cout<<isCircleToCircle(a,b)<<endl;

		//data.push_back(isCircleToCircle(a,b));
	}
	/*
	for(int i=0;i<n;i++){
		cout<<data.at(i)<<endl;
	}
	*/

	return 0;
}

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

#define P complex<double>

int main(){
  int n, ans;
  P a,b, z;
  double ra, rb, d;

  cin >> n;
  for( int loop=0;loop<n;loop++ ){
    cin >> a.real() >> a.imag() >> ra;
    cin >> b.real() >> b.imag() >> rb;
    /*
    cout << "a=" << a << " ra=" << ra << endl;
    cout << "b=" << b << " rb=" << rb << endl;
    */
    z = a-b;
    d=abs(z);
    //    cout << "d=" << d << endl;

    if( ra+rb < d ) // dÈÁÄ¢È¢
      ans = 0;
    else  if( ra > d + rb ){ // a ÌÉ b
      ans = 2;
    }else if( rb > d + ra ){ // b ÌÉ a
      ans = -2;
    }else 
      ans = 1; 

    cout << ans << endl;
  }
  return 0;
}

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

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

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) > d + EPS) {
      cout << 2 << endl;
    } else if (sq(rb) > d + EPS) {
      cout << -2 << endl;
    } else if (d > sq(ra + rb) + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}