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 <cmath>

using namespace std;

int main()
{
  int n, r;
  double xa, ya, ra, xb, yb, rb, d;

  while(cin>>n && n)
    while(n--){
      cin >> xa >> ya >> ra >> xb >> yb >> rb;
      d = sqrt(pow(xa-xb, 2.0)+pow(ya-yb, 2.0));
      if(fabs(ra-rb) > d){
	if(ra > rb) r = 2;
	else if(ra < rb) r = -2;
	else r = 1;
      } else if(d <= ra+rb && fabs(ra-rb) <= d){
	r = 1;
      } else {
	r = 0;
      }
      cout << r << endl;
    }

  return 0;
}

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

int main(){
	int n;
	scanf("%d",&n);
	for(;n--;){
		double a,b,r1,d,e,r2;
		scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&r1,&d,&e,&r2);
		
		double di=sqrt((a-d)*(a-d)+(b-e)*(b-e));
		
		if(di+r1<r2)printf("-2\n");
		else if(di+r2<r1)printf("2\n");
		else if(di>r2+r1)printf("0\n");
		else printf("1\n");
	}
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb,d;
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    // BがAの中にあるとき
    if(ra>rb && d < fabs(ra - rb)){
      cout << 2 << endl;
    } // AがBの中にあるとき
    else if(ra<rb && d < fabs(rb - ra)){
      cout << -2 << endl;
    } // 円周が交わってる
    else if(fabs(ra-rb) < d && d < ra + rb){
      cout << 1 << endl;
    } // 離れていないとき
    else if(d > ra + rb){
      cout << 0 << endl;
    }else {
      cout << 1 << endl;
    }
  }
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

#define vcitr vector<int>::iterator
#define vcsitr vector<string>::iterator
#define mapcitr map<char, int>::iterator
#define mapsitr map<string, int>::iterator

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }

struct Point2D { 
	double x, y;
	Point2D (double a=0, double b=0) { x=a; y=b; }
};

typedef Point2D Vector2D;

double dist2D(const Point2D& a, const Point2D& b) { return sqrt( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) ); }

Vector2D sub_vector2D(const Vector2D& a, const Vector2D& b) {
	Vector2D ret;
	ret.x = a.x - b.x; ret.y = a.y - b.y;
	return ret;
}

double cross_product(const Vector2D& a, const Vector2D& b) { return a.x*b.y - a.y*b.x; }

double inner_product(const Vector2D& a, const Vector2D& b) { return a.x*b.x + a.y*b.y; }

bool point_in_triangle_2D(const Point2D& a, const Point2D& b, const Point2D& c, const Point2D& p) {
	Vector2D ab = sub_vector2D(b, a); Vector2D bp = sub_vector2D(p, b);
	Vector2D bc = sub_vector2D(c, b); Vector2D cp = sub_vector2D(p, c);
	Vector2D ca = sub_vector2D(a, c); Vector2D ap = sub_vector2D(p, a);
	double c1 = cross_product(ab, bp), c2 = cross_product(bc, cp), c3 = cross_product(ca, ap);
	return ( (c1>0 && c2>0 && c3>0) || (c1<0 && c2<0 && c3<0) );
}

struct Circle {
	Point2D c; 
	double r;
	Circle (double a=0, double b=0, double rr=0) { c.x=a; c.y=b; r=rr; }
};

bool point_in_circle(const Point2D& p, const Circle& t) {
	double dist = dist2D(p, t.c);
	return (dist-t.r < 1e-9);
}

bool circle_collision (const Circle& a, const Circle& b) {
	double len = dist2D(a.c, b.c);
	return (a.r+b.r >= len);
}

bool circle_in_circle(const Circle& a, const Circle& b) {	// a in b
	double len = dist2D(a.c, b.c);
	return (a.r+len - b.r < 1e-9);
}

int main() {
	int n; cin >> n;
	Circle a, b;
	
	for_(i, 0, n) {
		cin >> a.c.x >> a.c.y >> a.r >> b.c.x >> b.c.y >> b.r;
		
		if (circle_in_circle(b, a)) cout << 2 << endl;
		else if (circle_in_circle(a, b)) cout << -2 << endl;
		else if (circle_collision(a, b)) cout << 1 << endl;
		else cout << 0 << endl;
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;

#define EPS 1e-8

int main(){

	int n;
	cin >> n;
	while(n--){
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d2 = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
		if(d2 == ra * ra + rb * rb) cout << 1 << endl;
		else if(sqrt(d2) > ra + rb) cout << 0 << endl;
		else if(ra > rb) cout << 2 << endl;
		else cout << -2 << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("-2");goto L;}
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("2");goto L;}
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        swap(a.first,a.second);swap(b.first,b.second);
         if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        puts("0");
    L:;
        
    }
}