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

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int n; cin >> n;
	while (n--) {
		double x1, y1, x2, y2, r1, r2; cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		double dis = pow(abs(x1 - x2)*abs(x1 - x2) + abs(y1 - y2)*abs(y1 - y2),0.5);
		if (r1 + r2 < dis)cout << 0 << endl;
		else if (abs(r1 - r2) <= dis&&dis <= abs(r1 + r2))cout << 1 << endl;
		else {
			if (dis < r1 - r2)cout << 2 << endl;
			else cout << -2 << endl;
		}
	}
	return 0;
}

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

int main(){
	float x1, x2, x3;
	float y1, y2, y3;
	int n, i;

	scanf("%d", &n);

	for(i=0;i<n;i++){
		scanf("%f %f %f %f %f %f", &x1, &x2, &x3, &y1, &y2, &y3);

		if((y2-x2)*(y2-x2)+(y1-x1)*(y1-x1) > (x3 + y3)*(x3 + y3))
			printf("0\n");
		else if((y2-x2)*(y2-x2)+(y1-x1)*(y1-x1) < (x3 - y3)*(x3 - y3)){
			if((x3 -y3) >0)
				printf("2\n");
			else
				printf("-2\n");
		}
		else
			printf("1\n");
	}
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int rep=0; rep<n; rep++){
		double x[2],y[2],r[2];
		cin>>x[0]>>y[0]>>r[0]>>x[1]>>y[1]>>r[1];
		double d = sqrt((x[1]-x[0])*(x[1]-x[0]) +(y[1]-y[0])*(y[1]-y[0]));
		if(d>r[0]+r[1]) cout << 0 << endl;
		else if(d<r[0]-r[1]) cout << 2 << endl;
		else if(d<r[1]-r[0]) cout << -2 << endl;
		else cout << 1 << endl;
	}
	return 0;
}

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

inline double distance(double x1,double y1,double x2,double y2){
	return sqrt( (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) number.push_back( 0 );
		//"2" if B is in A
		else if(ra > rb && (dis + rb <= ra) )  number.push_back( 2 );
		//"-2" if A is in B
		else if(rb > ra && (dis + ra <= rb) )  number.push_back( -2 );
		//"1" if circumference of A and B intersect
		else number.push_back( 1 );
	}
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	return 0;
	}

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

int main(void){
	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 d = sqrt( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) );

		if( ra+rb < d )
			cout << 0 << endl;
		else if( d+rb < ra )
			cout << 2 << endl;
		else if( d+ra < rb )
			cout << -2 << endl;
		else
			cout << 1 << endl;

	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

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 ab = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (ab + rb - ra <= EPS) cout << 2 << endl;
		else if (ab + ra - rb <= EPS) cout << -2 << endl;
		else if (ab - ra - rb <= -EPS) 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;

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