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>
#define y imag()
#define x real()
using namespace std;
typedef complex<double> P;

int main(){
  int n;
  P a,b;
  double ra,rb,d;
  cin>>n;
  while(n--){
    cin>>a.x>>a.y>>ra;
    cin>>b.x>>b.y>>rb;
    double A=a.x-b.x;
    double B=a.y-b.y;
    d=sqrt(A*A+B+B);
    if(d>ra+rb)cout<<0<<endl;
    else if(d+ra<rb)cout<<-2<<endl;
    else if(d+rb<ra)cout<<2<<endl;
    else cout<<1<<endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;

int main(void){
	double x1,x2,y1,y2,r1,r2;
	int n;
	cin >> n;
	rep(i,0,n){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2 ;
		x1 = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
		
		if(r1 >= x1 + r2){
			cout << 2;
		}
		else if(r2 >= x1 + r1){
			cout << -2;
		}
		else if(r1 + r2 < x1){
			cout << 0;
		}
		else{
			cout << 1;
		}
		cout << "\n";
	}
	return 0;
}

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

typedef complex<double> P;

const double eps = 1e-10;

//
//0:a include b
//1:b include a
//2:intersected
//3:same
//4:far away
// r1 >= r2
int is_intersected_circle(P a,P b,double r1,double r2){
  double d = abs(a-b);
  if (d<eps && abs(r1-r2)<eps)return 3;
  if (d+r2 < r1)return 0;
  if (d+r1 < r2)return 1;
  if (d > r1+r2)return 4;
  
  return 2;
}

main(){
  int op[5]={2,-2,1,100,0};
  P a,b;
  double r1,r2;
  int te;
  cin>>te;
  while(te--){
    cin>>a.real()>>a.imag()>>r1>>
      b.real()>>b.imag()>>r2;

      cout << op[is_intersected_circle(a,b,r1,r2)]<<endl;
  }
  
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define PI 3.14
int main(void)
{
  double xa,ya,ra,xb,yb,rb;
  double areaa,areab;
  double len;
  int n;
  
  cin >> n;
  for(int i = n ; i > 0 ; i--){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    
    areaa = ra * ra * PI;
    areab = rb * rb * PI;

    len = abs(xa - xb) * abs(xa - xb) + abs(ya - yb) * abs(ya - yb);
    len = sqrt(len);

    if(len > ra + rb) cout << 0 << endl;
    else if(ra + yb > len && len > ra - rb) cout << 1 << endl;
    else if(len < ra - rb && areaa > areab) cout << 2 << endl;
    else if(len < ra - rb && areab > areaa) cout << -2 << endl;
  }
  return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
struct en{
	pair<double, double> pos;
	double r;
};
int main() {
	int n;
	cin >> n;
	while (n--){
		en e1,e2;
		cin >> e1.pos.first >> e1.pos.second >> e1.r >> e2.pos.first >> e2.pos.second >> e2.r;
		double dis = hypot(e1.pos.first - e2.pos.first, e1.pos.second - e2.pos.second);
		if (e1.r>e2.r&&dis + e2.r<e1.r)cout << 2 << endl;
		else if (e1.r<e2.r&&dis+e1.r<e2.r)cout << -2 << endl;
		else if (e1.r + e2.r>=dis)cout << 1 << endl;
		else cout << 0 << endl;
	}
}

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

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

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = hypot(xa - xb, ya - yb);
		if (d > ra + rb)
		{
			std::cout << 0 << std::endl;
		}
		else
		{
			if (d == ra + rb || abs(ra - rb) < d)
			{
				std::cout << 1 << std::endl;
			}
			else
			{
				std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	while(n--){
		int a;
		double x[2], y[2], r[2], d2;
		for(int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i];
		d2 = (x[1]-x[0])*(x[1]-x[0]) - (y[1]-y[0])*(y[1]-y[0]);
		if(d2 > (r[0]+r[1])*(r[0]+r[1]) ) a = 0;
		else if(d2 > (r[0]-r[1])*(r[0]-r[1]) ) a = 1;
		else  r[0]>r[1] ? a = 2 : a = -2;
		cout << a << endl;
	}
	return 0;
}

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

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

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

inline double distance(double x1,double y1,double x2,double y2){
	return sqrt( (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) number.push_back( 0 );
		//"2" if B is in A
		else if(ra > rb && dis + rb <= ra) number.push_back( 2 );
		//"-2" if A is in B
		else if(rb > ra && dis + ra <= rb) number.push_back( -2 );
		//"1" if circumference of A and B intersect
		else number.push_back( 1 );
	}
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	return 0;
	}