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<complex>
#include<cmath>
#include<map>
#define fs first
#define sc second
#define EPS (1e-10)
using namespace std;


typedef complex<double> P;
typedef pair<P,int> C;

int cpr(C a,C b){
  double d = abs(a.fs-b.fs);
  if(a.sc+b.sc + EPS < d)return -1;      //no intersection (outside)
  if(abs(a.sc+b.sc - d) < EPS)return -3; //one cross point (outside)
  if(b.sc+d + EPS < a.sc)return 1;       //no intersection (inside,B in A)
  if(abs(b.sc+d - a.sc) < EPS)return 3;  //one cross point (inside,B in A)
  if(a.sc+d + EPS < b.sc)return 2;       //no intersection (inside,A in B)
  if(abs(a.sc+d - b.sc) < EPS)return 4;  //one cross point (inside,A in B)
  return 0;                              //two cross point
}


int main(){
  double ax,ay,ar,bx,by,br;

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin>> ax >> ay >> ar >> bx >> by >> br;
    C a = C(P(ax,ay),ar), b = C(P(bx,by),br);
    int v = cpr(a,b);
    if(v==1)cout <<  2 << endl;
    else if(v==2)cout << -2 << endl;
    else if(v==-1)cout << 0 << endl;
    else cout << 1 << endl;

  }
}

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

typedef double dbl;

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		dbl x[2], y[2], r[2];
		for (int j = 0; j < 2; j++) {
			cin >> x[j] >> y[j] >> r[j];
		}
		dbl d = sqrt(pow(x[1] - x[0], 2) + pow(y[1] - y[0], 2));
		if (d < fabs(r[0] - r[1])) {
			if (r[0] > r[1]) {
				cout << 2 << endl;
			}
			else {
				cout << -2 << endl;
			}
		}
		else if (d > r[0] + r[1]) {
			cout << 0 << endl;
		}
		else cout << 1 << endl;
	}
}

C++: #include<stdio.h>
#include<math.h>
#define EPS 1e-9
int n;
double xa,ya,ra,xb,yb,rb;

int main(){
	int i;
	scanf("%d",&n);
	
	for( i = 0;i < n;i++ ){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		//BがA中にあるか(境界ふくまない)
		if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra-rb)*(ra-rb) && rb < ra )
			printf("2\n");
		//AがB中にあるか(境界ふくまない)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra-rb)*(ra-rb) && ra < rb )
			printf("-2\n");
		//AとBが交わっているか(境界ふくまない)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra+rb)*(ra+rb) )
			printf("1\n");
		else
			printf("0\n");
	}
	return 0;
}

C++: // AOJ 0023
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const double EPS = 1e-5;

double sq(double x) {
  return x * x;
}

double abs(double x) {
  return (x > 0 ? x : -x);
}

bool eq(double x, double y) {
  return abs(x - y) < EPS;
}

double dist(int xa, int ya, int xb, int yb) {
  return sq(xa - xb) + sq(ya - yb);
}

int main() {
  int n;
  cin >> n;
  REP(i, n) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    double d = dist(xa, ya, xb, yb);
    
    if (d < sq(ra)) {
      cout << 2 << endl;
    } else if (d < sq(rb)) {
      cout << -2 << endl;
    } else if (eq(d, ra) or eq(d, rb)) {
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
  }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main()
{
  double xa,ya,ra,xb,yb,rb,d;
  int n;
  cin >> n;
  while(n--){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
    if(d + rb < ra) cout << "2" << endl;
    else if(d + ra < rb) cout << "-2" << endl;
    else if(d > ra + rb) cout << "0" << endl;
    else cout << "1" << endl;
  }
  return 0;
}

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

int main(void){
	int n;
	scanf("%d", &n);
	
	for(int i = 0; i < n; i++){
		double ax, ay, ar, bx, by, br;
		scanf("%lf %lf %lf %lf %lf %lf", &ax, &ay, &ar, &bx, &by, &br);
		double x = pow(ax-bx,2);
		double y = pow(ay-by,2);
		double r = pow(ar+br,2);
		
		if( x+y > r){
			puts("0");
		}else if(x+y == r){
			puts("1");
		}else if(x+y < r){
			if(br<ar){
				puts("2");
			}else{
				puts("-2");
			}
		}
	}
	
	return 0;
}

C++: #include<bits//stdc++.h>
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 z=sqrt(((d-a)*(d-a))+((e-b)*(e-b)));
		if(z<0){z*=-1;}
		
		if(c+f<z){cout<<'0'<<endl;}
		else if(z>f-c){cout<<"2"<<endl;}
		else if(z>c-f){cout<<"-2"<<endl;}
		else{cout<<"1"<<endl;}
		}
		return 0;
	}

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

using ld = long double;
const ld eps = 1e-8, pi = acos(-1.0);

bool eq(ld a, ld b) {
	return abs(a - b) < eps;
}

using Point = complex<ld>;
int main()
{
	int N;
	ld xa, ya, ra, xb, yb, rb;
	cin >> N;
	while (N--) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		ld dis = abs(Point(xa, ya) - Point(xb, yb));
		if (dis + rb < ra - eps) {
			cout << 2 << endl;
		}
		else if (dis + ra < rb - eps) {
			cout << -2 << endl;
		}
		else if (dis > ra + rb + eps) {
			cout << 0 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}