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<cstdio>
#include<cmath>
using namespace std;
	int main(){
		int n;
		double xa,xb,ya,yb,ra,rb,l,r1,r2;
		scanf("%d",&n);
		while(n-->0){
			scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
			l=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
			r1=ra+rb;
			r2=ra-rb;
			if(l>r1*r1)
					printf("0\n");
			else if(r1*r1>l&&r2*r2<l)
					printf("1\n");
			else if(r2*r2>l){
				if(r2>0)
					printf("2\n");
				else printf("-2\n");
			}
			else printf("1\n");
	 
		}
		return 0;
}

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

using namespace std;

int check(double *l, double *s);

int main()
{
	int n, ans;
	double a[3], b[3];	//[0]:x[1]:y[2]:r

	cin >> n;

	for (int i=0; i<n; i++)
	{
		cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];

		if(a[2] > b[2]) {		//aを大きい円、bを小さい円としたとき
			ans = check(&a[0], &b[0]);
		}
		else {					//bを大きい円、aを小さい円としたとき
			ans = check(&b[0], &a[0]);
			ans *= (ans == 2) ? -1 : 1;		//aがbの中にあるときの処理
		}

		cout << ans << endl;
	}

	return 0;
}

int check(double *l, double *s)	//円の重なり・内外を判定
{
	double d = (l[0]-s[0])*(l[0]-s[0]) + (l[1]-s[1])*(l[1]-s[1]);

	d = sqrt(d);

	if(d < l[2]-s[2]) {	//小さい円が大きい円の内側にあるとき
		return 2;
	}
	else if(l[2]-s[2] <= d && d <= l[2]+s[2]) {	//円周が交わっているとき
		return 1;
	}
	else {
		return 0;	//外側にあるとき
	}
}

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

using namespace std;

int main() {
    int n;
    double xa, ya, ra, xb, yb, rb, d;
    
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
        if(d + rb < ra)         { cout << "2"  << endl; }
        else if(d + ra < rb)    { cout << "-2" << endl; }
        else if(d <= ra + rb)   { cout << "1"  << endl; }
        else                    { cout << "0"  << endl; }
    }
    return 0;
}

C++: 
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <complex>

using namespace std;

int main()
{
  int N;
  scanf("%d ", &N);
  
  for (int i = 0; i < N; i++) {
    double xa, ya, ra, xb, yb, rb;
    scanf("%lf %lf %lf %lf %lf %lf ", &xa, &ya, &ra, &xb, &yb, &rb);
    complex<double> A(xa, ya), B(xb, yb);

    double k1 = fabs(ra - rb), k2 = ra + rb;
    double d = abs(A - B);
    int num;
    if (d < k1) {
      if (ra > rb) {
	num = 2;
      } else {
	num = -2;
      }
    } else if (k1 <= d && d <= k2) {
      num = 1;
    } else if (k2 < d) {
      num = 0;
    }
    
    printf("%d\n", num);
  }
  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-12;

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 - rb) > d + EPS and ra > rb + EPS) {
      cout << 2 << endl;
    } else if (sq(rb - ra) > d + EPS and rb > ra + EPS) {
      cout << -2 << endl;
    } else if (d > sq(ra + rb) + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<iomanip>
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 a){ return Point(a * x, a * y);}
		Point operator / (double a){ return Point(x / a, y / a);}

		double abs(){ return sqrt(norm());}
		double norm(){ return x * x + y * y;}

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

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

double getDistance(Point a, Point b){
	return (a - b).abs();
}

int main(){
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++){
		Circle a, b;
		cin >> a.c.x >> a.c.y >> a.r >> b.c.x >> b.c.y >> b.r;
		if(a.r > (b.r + getDistance(a.c, b.c))) cout << 2 << endl;
		else if(b.r > (a.r + getDistance(a.c, b.c))) cout << -2 << endl;
		else if(a.r + b.r < getDistance(a.c, b.c)) cout << 0 << endl;
		else cout << 1 << 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 pow(a.x,2.0)+pow(a.y,2.0);
}
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+b.r-a.r<0) return 2;
  if(d1+a.r-b.r<0) return -2;
  if(d1-d2<=0) return 1;
  return 0;
}
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;

int main(){

  typedef struct{
    double x, y, r;
  }_CirclePara;
  
  int n;
  double d;
  _CirclePara a, b;
  
  cin >> n;
  for(int i=0; i<n; i++){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
  	
  	d = sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2));
	  if(a.r + b.r < d) cout << 0 << endl;
	  else if(a.r - b.r > d) cout << 2 << endl;
	  else if(b.r - a.r > d) cout << -2 << endl;
	  else cout << 1 << endl;
  }

  return 0;

}

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

using namespace std;
 
int main(){
	int n, ans;
	double xa,ya,ra,xb,yb,rb,ab;

	cin >>n;
	while(n--){
		cin >>xa>>ya>>ra>>xb>>yb>>rb;
		
		ab=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		ans=1;
		if(ab>(ra+rb)) ans=0;
		if(ra>(ab+rb)) ans=2;
		if(rb>(ab+ra)) ans=-2;

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

C++: #include <stdio.h>
#include <math.h>
  int main(){
    int n,i;
    double xa,ya,ra,xb,yb,rb;
    scanf("%d",&n);
     for(i=0;i<n;i++){
       scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
	   double q=xa-xb;
	   double r=ya-yb;
	   double s=ra-rb;
       double dis=q*q+r*r;   
       dis = sqrt(dis);
       if(dis>ra+rb){
printf("%d\n",0);
continue;
}else if(dis<ra+rb && dis*dis>s*s){
printf("%d\n",1);
continue;
}else if(dis*dis<s*s){
	if(ra>rb){
printf("%d\n",2);
continue;
	}else{
		printf("%d\n",2);
		continue;
	}
}
else{
	printf("%d\n",1);
	continue;
}
}
return 0;
}