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 <vector>
#include <cmath>

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

int judge(std::vector<float> ve){
	float center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(ve[2] > center_dis + ve[5]){
		return 2;
	}else if(ve[5] > center_dis + ve[2]){
		return -2;
	}else{
		return 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++: // 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 <stdio.h>
#include <math.h>

int main(){
	int n;
	float xa,ya,ra,xb,yb,rb;
	float L;
	int i;
	
	scanf("%d",&n);
	
	for(i = 0;i < n;i++){
		scanf("%f %f %f %f %f %f",&xa,&ya,&ra,&xb,&yb,&rb);
		L = sqrt(pow(xa-xb,2) + pow(ya-yb,2));
		if(L > ra+rb){
			printf("0\n");
		}else if(L >= fabs(ra-rb)&&L <=ra+rb){
			printf("1\n");
		}else if(L < fabs(ra-rb)){
			if(ra > rb){
				printf("2\n");
			}else{
				printf("-2\n");
			}
		}
	}
	
	return 0;
}

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

int check_intersection(const double ra, const double rb, const double distance){
	if(distance > (ra + rb)){
		return 0;
	}else if(ra > rb){
		return ((distance + rb) <= ra) ? 2 : 1;
	}else{
		return ((distance + ra) <= rb) ? -2 : 1;
	}
}

int main(){
	int data_set;
	std::cin >> data_set;
	std::vector<double> xa(data_set), ya(data_set), ra(data_set), xb(data_set), yb(data_set), rb(data_set);
	for(int i = 0; i < data_set; ++i){
		std::cin >> xa[i] >> ya[i] >> ra[i] >> xb[i] >> yb[i] >> rb[i];
	}
	double distance;
	for(int i = 0; i < data_set; ++i){
		distance = sqrt(pow(xa.at(i) - xb.at(i), 2) + pow(yb.at(i) - yb.at(i), 2));
		std::cout << check_intersection(ra.at(i), rb.at(i), distance) << std::endl;
	}
	return 0;
}

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

int main() {
	double a, b, c, d, e, f;
	int n;
	cin >> n;
	for(int i=0;i<n;i++)
	 {
		cin >> a >> b >> c >> d >> e >> f;

		double g = sqrt(((a + d)*(a + d) + (b + e)*(b + e)));
		if (g > c + f) { cout << "0" << endl; }
		else if (g < f - c) { cout << "-2" << endl; }
		else if (g < c - f){ cout << "2" << endl; }
		else { cout << "1" << endl; }
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

double eps = 1e-10;

class Point {
public:
	double x, y;
	
	Point(double x = 0, double y = 0) : x(x), y(y) {}
	
	Point operator + (const Point& p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (const Point& p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (const double& a) {
		return Point(x * a, y * a);
	}
	Point operator / (const double& a) {
		return Point(x / a, y / a);
	}
	
	bool operator < (const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator == (const Point& p) const {
		return fabs(x - p.x) < eps && fabs(y - p.y) < eps;
	}
	
	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	
};

class Circle {
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) : c(c), r(r) {}
};

int main() {
	int n;
	cin >> n;
	double x1, y1, r1, x2, y2, r2;
	for(int i = 0; i < n; ++i){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		Circle c1 = Circle(Point(x1, y1), r1);
		Circle c2 = Circle(Point(x2, y2), r2);
		double minr = min(c1.r, c2.r);
		double maxr = max(c1.r, c2.r);
		double dr = maxr - minr;
		
		if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) < pow(dr, 2.0)){
			if(c1.r > c2.r)
				cout << "2" << endl;
			else
				cout << "-2" << endl;
		}
		else if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) <= pow(c1.r + c2.r, 2.0)){
			cout << "1" << endl;
		}
		else{
			cout << "0" << endl;
		}
	}
	return 0;
}

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

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((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 dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist)
			cout<<0<<endl;
		// ~üªðíé
		else if(EQ(abs(ra-rb)*abs(ra-rb),dist)||(abs(ra-rb))*(abs(ra-rb))<dist)
			cout<<1<<endl;
		else
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
	}

	return 0;
}

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

int main(){
	int N;
	double xa,ya,ra,xb,yb,rb;
	
	scanf("%d",&N);
	while(N--){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		if(ra>rb+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))){
			printf("2\n");
		}else if(rb>ra+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))){
			printf("-2\n");
		}else if(ra==rb+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)) || rb==ra+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)) || ra+rb==sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long int ll;
int main()
{
	int n;
    double xa,ya,ra,xb,yb,rb;
	cin >> n;
	for(int i=0;i<n;i++){
	cin >> xa >> ya >> ra >> xb >> yb >> rb;
	double a=sqrt((yb-ya)*(yb-ya)+(xb-xa)*(xb-xa));
	if(a>ra+rb){
		printf("0\n");
	}
	else if(abs(ra-rb)<a){
		printf("1\n");
	}
	else if(ra>rb)printf("2\n");
	else printf("-2\n");
	}
    return 0;
}