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++: /*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;

		data.push_back(isCircleToCircle(a,b));
	}

	for(int i=0;i<n;i++){
		cout<<data.at(i)<<endl;
	}


	return 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 == 0 || 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;
}

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

struct circle{
	double r,x,y;
};

int main(){
	int n;
	while(scanf("%d",&n)==1,n){
		for(int x=0;x<n;++x){
			circle a,b;
			scanf("%lf %lf %lf %lf %lf %lf",&a.x,&a.y,&a.r,&b.x,&b.y,&b.r);
			double d = sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
			if(d>a.r+b.r){
				cout<<0<<endl;
			}else if(a.r+d<b.r){
				cout<<-2<<endl;
			}else if(b.r+d<a.r){
				cout<<2<<endl;
			}else{
				cout<<1<<endl;
			}
		}
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb,d;
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    // BがAの中にあるとき
    if(ra>rb && d < fabs(ra + rb)){
      cout << 2 << endl;
    } // AがBの中にあるとき
    else if(ra<rb && d < fabs(ra + rb)){
      cout << -2 << endl;
    } // 円周が交わってる
    else if(fabs(ra-rb) < d && d < ra + rb){
      cout << 1 << endl;
    } // 離れていないとき
    else if(d > ra + rb){
      cout << 0 << endl;
    }else {
      cout << 1 << endl;
    }
  }
}

C++: #include<iostream>
#include<vector>
#include<cmath>
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 dx=xb-xa,dy=yb-ya;
		double d=sqrt(dx*dx+dy*dy);
		if(ra+rb<d) cout<<"0"<<endl;
		else if(ra>rb and ra-rb>d) cout<<"2"<<endl;
		else if(rb>ra and rb-ra>d) cout<<"-2"<<endl;
		else cout<<"1"<<endl;
	}
	return 0;
}

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

inline float distance(float xa, float ya, float xb, float yb){
	return std::sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));
}

inline int judge(std::vector<float> ve){
	float center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	float r_dis = ve[2] + ve[5];
	if(center_dis > r_dis){
		return 0;	
	}else{
		if(ve[2] > ve[5]){
			return center_dis + ve[5] <= ve[2] ? 2 : 1;
		}else{
			return center_dis + ve[2] <= ve[5] ? -2 : 1;
		}
	}
}

int main(void){
	int num;
	std::vector<float> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
    double xa, ya, ra, xb, yb, rb;
    double d;
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));

        if (d > ra + rb) 
            cout << 0 << endl;
        else if (d <= abs(ra - rb))
            cout << 2 << endl;
        else if (d <= abs(rb - ra))
            cout << -2 << endl;
        else if ((abs(ra - rb) < d) && (d < abs(ra + rb)))
            cout << 1 << endl;
    }

    return 0;
}

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

int main(){
	int N;
	std::cin >> N;
	
	while(N--){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = hypot((xa - xb), (ya - yb)); //distance
		
		if(d > ra + rb)
			std::cout << 0 << std::endl;
		else if(d < fabs(ra - rb))
			std::cout << (ra - rb ? 2 : -2) << std::endl;
		else
			std::cout << 1 << std::endl;
	}
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <complex>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define rep(i,n) for (int i=0; i < (n); i++)

typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = 1e-9;    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) {
  return (conj(a)*b).Y;
}

// 2円の共通接線。返される各直線に含まれる頂点は円との接点となる
vector<L> tangentLines(P a, D ar, P b, D br) {
  vector<L> ls;
  D d = abs(b-a);
  rep (i,2) {
    D sin = (ar - (1-i*2)*br) / d;
    if (!LE(sin*sin, 1)) break;
    D cos = sqrt(max(1 - sin*sin, 0.0));
    rep (j,2) {
      P n = (b-a) * P(sin, (1-j*2)*cos) / d;
      ls.push_back(L(a + ar*n, b + (1-i*2)*br*n));
      if (cos < EPS) break;  // 重複する接線を無視（重複していいならこの行不要）
    }
  }
  return ls;
}

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

    vector<L> ls = tangentLines(P(xa,ya), ra, P(xb,yb), rb);
    if (ls.size() == 4) cout << 0;
    else if (ls.size() == 0) cout << ((ra < rb) ? -2 : 2);
    else cout << 1;
    cout << endl;
  }
  return 0;
}