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++: #include <iostream>
#include <vector>
#include <cmath>
#include <set>
using namespace std;
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<n;i++)

class C{
public:
	double x;
	double y;
	double r;
};

double euc(C a,C b){
	a.x -= b.x;
	a.y -= b.y;
	return sqrt(a.x*a.x+a.y*a.y);
}

int main(){
	int n;
	C a,b;
	cin >> n;
	while(n--){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		
		if( euc(a,b)+b.r < a.r && a.r > b.r ){
			cout << 2 << endl;
		}else if( euc(a,b)+a.r < b.r && b.r > a.r ){
			cout << -2 << endl;
		}else if(euc(a,b)-b.r <= a.r || euc(a,b)-a.r <= b.r){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
}

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

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair
typedef long long LL;
#define EPS (1e-6)
double zero(double d){
  return d < EPS ? 0.0 : d;
}

typedef pair<int,int> P;


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(7);
  int INF = 1000000;

  int N;
  while(cin>>N){
    double x1,y1,r1,x2,y2,r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

    double dis = sqrt( pow((x1-x2),2) + pow((y1-y2),2) );
    if( dis >= r1+r2 )
      cout << "0" << endl;
    else if( r1 >= r2+dis )
      cout << "2" << endl;
    else if( r2 >= r1+dis )
      cout << "-2" << endl;
    else
      cout << "1" << endl;
  }

  return 0;
}

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

using namespace std;

int main() {
	int n, ans;
	double x1, y1, r1, x2, y2, r2, dis;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		dis = hypot(x2 - x1, y2 - y1);
		ans = 0;

		if (dis < r1 - r2) { ans = 2; }
		else if (dis < r2 - r1) { ans =  -2; }
		else if (r1 + r2 >= dis) { ans = 1; }

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

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define EPS 1e-10
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

double distanceAB(double xa, double ya, double xb, double yb);

/*
class Target
{
public:
	vector <string> draw(int n)
	{

	}
};
*/



int main()
{
	int n;
	double xa, ya, ra, xb, yb, rb;
	double dist, rsum;
	
	cin >> n;
	REP(n)
	{
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		dist = distanceAB(xa, ya, xb, yb);
		rsum = ra + rb;
		if (dist > rsum)
		{
			cout << 0 << endl;
		} else if (fabs(ra - rb) > dist) {
			//円が含まれている場合
			if (ra > rb)
			{
				cout << 2 << endl;
			} else {
				cout << -2 << endl;
			}
		} else {
			cout << 1 << endl;
		}
	}
	
	return 0;
}



double distanceAB(double xa, double ya, double xb, double yb)
{
	return sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
}

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		double d = (ax-bx)*(ax-bx) + (ay-by)*(ay-by);

		d = sqrt(d);

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

C++: #include <iostream>
#include <array>
#include <math.h>

int main(){

	std::array<double, 3> a; //0:xa 1:ya 2:ra
	std::array<double, 3> b;

	int N;

	std::cin >> N;

	for(int i = 0; i < N; ++i){
		
		for(int j = 0; j < 3; ++j)
			std::cin >> a[j];

		for(int j = 0; j < 3; ++j)
			std::cin >> b[j];

		double ab = sqrt( (a[0] * b[0]) + (a[1] * b[1]) );

		if( ab > (a[2] + b[2]) )
			std::cout << 0 << std::endl;
		
		else if ( a[2] > ab + b[2] )
			std::cout << 2 << std::endl;

		else if ( b[2] > ab + a[2] )
			std::cout << -2 << std::endl;

		else
			std::cout << 1 << std::endl;

	}
	
	return 0;

}

C++: #include <iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<cstdlib>
#include<cmath>

using namespace std;
int n,a[50];
int solve(int i){
    if(i==1||i==0)return 1;
    return solve(i-1)+solve(i-2);
}
int main(){
    int nl;
    cin>>nl;
    for(int i=0; i<nl; i++){
        double xa,ya,ra,xb,yb,rb;
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    double k=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
    double s=sqrt(k);
    
    if(ra+rb<s)cout<<0<<endl;
    else if(ra+rb>=s&&s>=abs(ra-rb))cout<<1<<endl;
    else if(ra-rb>s)cout<<2<<endl;
    else if(rb-ra>s)cout<<-2<<endl;
    }
    return 0;
}

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

using namespace std;

double dis(long double x1,long double y1,long double x2,long double y2);

int main(){
	long double x1,y1,r1;
	long double x2,y2,r2;
	long double ans;
	double r[2];
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x1>>y1>>r1;
		cin>>x2>>y2>>r2;
		
		ans=dis(x1,y1,x2,y2);
		
		if(ans>r1+r2){
			cout<<"0"<<endl;
		}else if(ans<=r1+r2){
				if(r2>ans+r1){
					cout<<"-2"<<endl;
					continue;
				}else if(r1>ans+r2){
					cout<<"2"<<endl;
					continue;
				}
			
			cout<<"1"<<endl;
		}
	
	}
}

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

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

using namespace std;

int main()
{
	int n;
	double x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	while(n--){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
		
		if(u+r2 <= r1){
			cout << "2" << endl;
		} else if(u+r1 <= r2){
			cout << "-2" << endl;
		} else if(r1+r2 == u){
			cout << "0" << endl;
		} else {
			cout << "1" << endl;
		}
	}
	
	return 0;
}