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 <vector>
#include <cmath>

inline double distance(double xa, double ya, double xb, double yb){
	return std::sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
}

int judge(std::vector<double> ve){
	double center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(ve[2] >= center_dis + ve[5]){
		return 2;
	}else if(ve[5] >= center_dis + ve[2]){
		return -2;
	}else{
		return 1;
	}
}

int main(void){
	int num;
	std::vector<double> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

C++: #include <iostream> 
#include <cmath> 
#include <string> 
#include <vector>
   
 using namespace std; 
  int main() { 
    int n; 
    cin >> n; 
    for (int i = 0; i < n; i++) { 
        double ax,ay,ar,bx,by,br; 
        cin >> ax >> ay >> ar >> bx >> by >> br; 
        double dis_x = abs(ax-bx);
        double dis_y = abs(ay-by); 
double dist = sqrt(dis_x * dis_x + dis_y * dis_y);
        if ( dist > ar + br )
             cout << 0;  } 
else if ( dist + ar < br ) { 
             cout << -2;  }
 else if ( dist + br < ar ) { 
             cout << 2;  } 
else 
             cout << 1<< 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( dis >= max(r1,r2) )
      cout << 1 << endl;
    else if( r1 >= r2+dis )
      cout << 2 << endl;
    else 
      cout << -2 << endl;
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

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

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
using namespace std;

int main(){

  int n;
  cin >> n;
  for(int i=0; i<n; i++){
    double xa, ya, ra;
    double xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    int ans = 0;

    if( ra*ra > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + rb*rb ) ans = 2;
    else if( rb*rb > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + ra*ra ) ans = -2;
    else if( (ra*ra)+(rb*rb) >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) ans = 1;


    cout << ans << endl;
  }

  return 0;
}

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

int main(void){
	int n = 0;
	double xa, ya, ra, xb, yb, rb;
	double d = 0.0;
	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%lf %lf %lf %lf %lf %lf",
			&xa, &ya, &ra, &xb, &yb, &rb);
		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));

		if(d > ra+rb){
			puts("0");
		}else if(ra > d+rb){
			puts("2");
		}else if(rb > d+ra){
			puts("-2");
		}else{
			puts("1");
		}
	}
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	while(n-->0){
		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(ra>d+rb) cout << 2 << endl;
		else if(rb>d+ra) cout << -2 << endl;
		else if(d>ra+rb) cout << 0 << endl;
		else cout << 1 << endl;
		cout << d << endl;
	}
}

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

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

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

double eps = 1e-10;

class Point {
public:
	double x, y;
	
	Point(double x = 0, double y = 0) : x(x), y(y) {}
	
	Point operator + (const Point& p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (const Point& p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (const double& a) {
		return Point(x * a, y * a);
	}
	Point operator / (const double& a) {
		return Point(x / a, y / a);
	}
	
	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;
	}
	
	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	
};

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

int main() {
	int n;
	cin >> n;
	double x1, y1, r1, x2, y2, r2;
	for(int i = 0; i < n; ++i){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		Circle c1 = Circle(Point(x1, y1), r1);
		Circle c2 = Circle(Point(x2, y2), r2);
		double minr = max(c1.r, c2.r);
		
		if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) < pow(minr, 2.0)){
			if(c1.r > c2.r)
				cout << "2" << endl;
			else
				cout << "-2" << endl;
		}
		else if(pow(c2.c.x - c1.c.x, 2.0) + pow(c2.c.y - c1.c.y, 2.0) <= pow(c1.r + c2.r, 2.0)){
			cout << "1" << endl;
		}
		else{
			cout << "0" << endl;
		}
	}
	return 0;
}

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

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-6

double sqr(double x, double y){
	return x*x + y*y;
}
int main(){
	int n;
	double xa,ya,ra,xb,yb,rb;
	scanf("%d",&n);
	rep(i,n){
		scanf("%lf %lf %lf %lf %lf %lf",
					&xa,&ya,&ra,&xb,&yb,&rb);
		double z = sqrt(sqr(xa-xb,ya-yb));
		//printf("z:%lf   ra+rb:%lf\n",z,ra+rb);
		if( z > ra+rb ){
			puts("0");
		}else{
			if( z>ra && z>rb ){
				puts("1");
			}else if( z-rb>z-ra ){
				puts("2");
			}else{
				puts("-2");
			}
		}
	}
	return 0;
}

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

using namespace std;

int main() {
  
  int N; cin >> N;
  double xa, ya, xb, yb, ra, rb;
  while(N--) {
    cin >> xa >> ya >> ra;
    cin >> xb >> yb >> rb;
    double dist2 = pow(xb-xa, 2) + pow(yb-ya, 2);
    
    if(dist2 < pow(ra-rb, 2)&& rb < ra) {
      cout << 2 << endl;
    }
    else if(dist2 < pow(ra-rb, 2) && ra < rb) {
      cout << -2 << endl;
    }
    else if(dist2 < pow(ra+rb, 2)) {
      cout << 1 << endl;
    }
    else {
      cout << 0 << endl;
    }
  }
  return 0;
}