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

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

C++: #include<iostream>
#include<complex>
#include<cmath>
#include<map>
#define fs first
#define sc second
#define EPS (1e-10)
using namespace std;


typedef complex<double> P;
typedef pair<P,double> C;

int cpr(C a,C b){
  double d = abs(a.fs-b.fs);
  if(a.sc+b.sc + EPS < d)return -1;      //no intersection (outside)
  if(d + EPS < a.sc-b.sc)return 1;       //no intersection (inside,B in A)
  if(d + EPS < b.sc-a.sc)return 2;       //no intersection (inside,A in B)
  if(abs(a.sc+b.sc - d) < EPS)return -3; //one cross point (outside)
  if(abs(b.sc+d - a.sc) < EPS)return 3;  //one cross point (inside,B in A)
  if(abs(a.sc+d - b.sc) < EPS)return 4;  //one cross point (inside,A in B)
  return 0;                              //two cross point
}


int main(){
  double ax,ay,ar,bx,by,br;

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin>> ax >> ay >> ar >> bx >> by >> br;
    C a = C(P(ax,ay),ar), b = C(P(bx,by),br);
    int v = cpr(a,b);
    if(v==-1)cout <<  0 << endl;
    else if(v==1)cout << 2 << endl;
    else if(v==2)cout << -2 << endl;
    else cout << 1 << endl;
  }
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main(void) {
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        double x, y, r, X, Y, R;
        cin >> x >> y >> r >> X >> Y >> R;
        double d = sqrt((X-x) * (X - x) + (Y - y) * (Y - y));
        if (r >= d + R) {
            cout << 2 << endl;
        } else if (R >= d + r) {
            cout << -2 << endl;
        } else if (r - R <= d && d <= r + R) {
            cout << 1 << endl;
        } else {
            cout << 0 << endl;
        }
    }
    return 0;
}