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++: #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 = max(c1.r, c2.r);
		double maxr = max(c1.r, c2.r);
		
		if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) + pow(minr / 2.0, 2.0) < pow(maxr, 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 <array>

inline double squ_minus(double a, double b){
	double x = a - b;
	return x * x;
}

inline double squ_plus(double a, double b){
	double x = a + b;
	return x * x;
}

int main(){
	int n; // the number of datasets
	std::cin >> n;
	
	for(int i = 0; i < n; ++i){
		std::array<double, 6> cir; // 0:xa, 1:ya, 2:ra, 3:xb, 4:yb, 5:rb
		std::cin >> cir[0] >> cir[1] >> cir[2] >> cir[3] >> cir[4] >> cir[5];

		double dis = squ_minus(cir[0], cir[3]) + squ_minus(cir[1], cir[4]);
		
		if(dis > squ_plus(cir[2], cir[5])){
			std::cout << "0" << std::endl;
		}else if(dis < squ_minus(cir[2], cir[5])){
			std::cout << (cir[2] >= cir[5] ? "2" : "-2") << std::endl;
		}else{
			std::cout << "1" << std::endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
#define equals(a,b) (fabs((a) - (b)) < EPS)
class Point{
public:
  double x,y;
  Point(double x = 0, double y = 0):x(x), y(y) {}
  Point operator + (Point p){
    return Point(x+p.x,y+p.y);
  }
  Point operator - (Point p){
    return Point(x-p.x,y-p.y);
  }
  Point operator * (double k){
    return Point(x*k,y*k);
  }
  Point operator / (double k){
    return Point(x/k,y/k);
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
typedef Point Vector;
double norm(Vector a){
  return a.x*a.x+a.y*a.y;
}
double abs(Vector a){
  return sqrt(norm(a));
}
class Circle{
public:
  Point c;
  double r;
  Circle(Point c = Point(),double r = 0.0):c(c),r(r){}
};
int check(Circle a,Circle b){
  double d1 = abs(b.c-a.c) , d2 = (a.r+b.r);
  if(d1-d2>EPS) return 0;
  if(d1+b.r-a.r<EPS) return 2;
  if(d1+a.r-b.r<EPS) return -2;
  return 1;
}
int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    Point a,b;
    double r1,r2;
    cin >> a.x >> a.y >> r1 >> b.x >> b.y >> r2;
    Circle c1(a,r1),c2(b,r2);
    cout << check(c1,c2) << endl;
  }
  return 0;
}

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

using namespace std;

void solve()
{
	int N;
	cin >> N;
	while(N--)
	{
		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(d > ra + rb)
		{
			cout << 0 << endl;
		}
		else if(d + rb < ra)
		{
			cout << 2 << endl;
		}
		else if(d + ra < rb)
		{
			cout << -2 << endl;
		}
		else
		{
			cout << 1 << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;
double ab(double a){
	if(a>=0)return a;
	return -a;
}
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(ab(ra-rb)<a){
		printf("1\n");
	}
	else if(ra>rb)printf("2\n");
	else printf("-2\n");
	}
    return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  ll n,i;
  ld xa,ya,ra,xb,yb,rb;
  ld dist;

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );//2????????????????????¢

    if(dist>ra+rb)//AB?????¢??????????????¨???
      cout<<"0"<<endl;
    else{
      if((rb<dist && ra<dist )|| ra==rb)//?????????????????¢??????????????????????????§??????
	cout<<"1"<<endl;
      else if(rb<ra && dist<ra)
	cout<<"2"<<endl;
      else if(ra<rb && dist<rb)
	cout<<"-2"<<endl;
    }
  }
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
#define equals(a,b) (fabs((a) - (b)) < EPS)
class Point{
public:
  double x,y;
  Point(double x = 0, double y = 0):x(x), y(y) {}
  Point operator + (Point p){
    return Point(x+p.x,y+p.y);
  }
  Point operator - (Point p){
    return Point(x-p.x,y-p.y);
  }
  Point operator * (double k){
    return Point(x*k,y*k);
  }
  Point operator / (double k){
    return Point(x/k,y/k);
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
typedef Point Vector;
double norm(Vector a){
  return a.x*a.x+a.y*a.y;
}
double abs(Vector a){
  return sqrt(norm(a));
}
class Circle{
public:
  Point c;
  double r;
  Circle(Point c = Point(),double r = 0.0):c(c),r(r){}
};
int check(Circle a,Circle b){
  double d1 = abs(b.c-a.c) , d2 = (a.r+b.r);
  if(d1-d2>EPS) return 0;
  if(d1+b.r-a.r<EPS) return 2;
  if(d1+a.r-b.r<EPS) return 2;
  return 1;
}
int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    Point a,b;
    double r1,r2;
    cin >> a.x >> a.y >> r1 >> b.x >> b.y >> r2;
    Circle c1(a,r1),c2(b,r2);
    cout << check(c1,c2) << endl;
  }
  return 0;
}