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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

C++: #include <iostream>
#include <vector>
 
inline int func(const int x){
	return x * x;
}


int state_circles(const std::vector<double> &a, const std::vector<double> &b){
    double d;
    d = func(a[0] - b[0]) + func(a[1] - b[1]);
    if(func(a[2] + b[2]) < d)
        return 0;
    if(func(a[2] - b[2]) > d){
        if(a[2] > b[2])
            return 2;
        else
            return -2;
    }
     
    else
        return 1;
}
 
int main(){
    std::vector<double> a(3), b(3);
    int data_num;
    std::cin >> data_num;
    for(int i = 0; i < data_num; ++i){ 
        std::cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];
        std::cout << state_circles(a, b) << std::endl;
    }
     
    return 0;
}

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

using namespace std;

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

    cin >> num;
    for (int i = 0; i < num; i++) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        
        ra *= ra;
        rb *= rb;
        d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);

        if (d > ra + rb) 
            cout << 0 << endl;
        else if ((abs(ra - rb) < d) && (d < abs(ra + rb)))
            cout << 1 << endl;
        else if (d < abs(ra - rb))
            cout << 2 << endl;
        else if (d < abs(rb - ra))
            cout << -2 << endl;
    }

    return 0;
}

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

int main()
{
	int n;
	double xa, ya, ra, xb, yb, rb;
	
	cin >> n;
	while(n--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		//B in A
		if( hypot(xa - xb, ya - yb) + rb <= ra )
			cout << 2 << endl;
		//A in B
		else if( hypot(xa - xb, ya - yb) + ra <= rb )
			cout << -2 << endl;
		//A intersect B
		else if( hypot(xa - xb, ya - yb) <= ra + rb )
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

C++: #include <cstdio.h>
#include <algorithm>

using namespace std;
int main(void)
{
	double xa, ya, ra, xb, yb, rb;
	int n;
	
	scanf("%d", &n);
	
	for (int i = 0; i < n; i++){
		scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
		
		if ((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) <= (ra + rb) * (ra + rb)){
			
			if ((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) + rb * rb <= ra * ra){
				printf("2\n");
			} 
			else if ((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) + ra * ra <= rb * rb){
				printf("-2\n");
			}
			else printf("1\n");
		}
		else {
			printf("0\n");
		}
	}
			
	
	
	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 d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if(d > ra + rb) cout << 0 << endl;
		else if(fabs(d - (ra + rb)) < EPS) cout << 1 << endl;
		else if(ra > rb) cout << 2 << endl;
		else cout << -2 << endl;
	}
	return 0;
}

C++: #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair
typedef long long LL;
#define EPS (1e-6)
double zero(double d){
  return d < EPS ? 0.0 : d;
}

typedef pair<int,int> P;


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(7);
  int INF = 1000000;

  int N;
  while(cin>>N){
    double x1,y1,r1,x2,y2,r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

    double dis = sqrt( pow((x1-x2),2) + pow((y1-y2),2) );
    if( dis > r1+r2 )
      cout << 0 << endl;
    else if( r2 > r1+dis )
      cout << -2 << endl;
    else if( r1 > r2+dis )
      cout << 2 << endl;
    else
      cout << 1 << endl;
  }

  return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

int main(){
    int mod=1000000007;
    int n;
    int ans;
    double xa,ya,ra,xb,yb,rb;
    scanf("%d",&n);
    for (int i=0;i<n;i++) {
        scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
        double tmp=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if ((tmp+rb*rb)<=(ra*ra)) {
            printf("2\n");
        } else if ((tmp+ra*ra)<=(rb*rb)) {
            printf("-2\n");
        } else if ((tmp)<(ra*ra+rb*rb)) {
            printf("1\n");
        } else {
            printf("0\n");
        }
    }
    return 0;
}