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 <cstdio>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;

int main() {
	int n; scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		double xa,ya,ra,xb,yb,rb;
		scanf("%lf%lf%lf%lf%lf%lf", &xa,&ya,&ra,&xb,&yb,&rb);
		ra = fabs(ra);
		rb = fabs(rb);
		double xd = xa-xb;
		double yd = ya-yb;
		double rd = ra+rb;
		double rd2 = fabs(ra-rb);
		double sq_cdist = xd*xd+yd*yd;
		double sq_rdist = rd*rd;
		double sq_rdist2 = rd2*rd2;
		if(sq_cdist<sq_rdist2) {
			if(ra>rb) {
				printf("2\n");
			} else {
				printf("-2\n");
			}
		} else if(sq_cdist<=sq_rdist) {
			printf("1\n");
		} else {
			printf("0\n");
		}
	}
	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(fabs(r[0] + r[1] - d) < 1e-10) ans = 1;
        else if(r[0] > d + r[1]) ans = 2;
        else if(r[1] > d + r[0]) ans = -2;
        cout << ans << endl;
    }
}

C++: #include <cmath>
#include <cstdio>
int n; long double xa, ya, ra, xb, yb, rb;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%Lf%Lf%Lf%Lf%Lf%Lf", &xa, &ya, &ra, &xb, &yb, &rb);
		long double dist = sqrtl((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if(dist >= ra + rb - 1e-6) {
			printf("0\n");
		}
		else if(dist <= ra - rb + 1e-6) {
			printf("2\n");
		}
		else if(dist <= rb - ra + 1e-6) {
			printf("-2\n");
		}
		else  {
			printf("1\n");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;

int main(){
	int num ;
	cin >> num;
	for(int j = 1;j<= num; j++){
	double x[2],y[2],r[2],r2[2];
	for(int i =0;i<=1;i++){
		cin >> x[i];
		cin >> y[i];
		cin >> r[i];
	}
	double d;
	d = sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
	if((r[0]+r[1])<d) cout << 0 << endl;
	else if(d > r[0]|| d > r[1]) cout << 1 << endl;
	else if(r[0]<r[1]) cout << -2 << endl;
	else cout << 2 << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<complex>
#define EPS 1e-10
using namespace std;

typedef complex<double>P;

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		double ra,rb;
		P pa,pb;
		
		cin>>pa.real()>>pa.imag()>>ra;
		cin>>pb.real()>>pb.imag()>>rb;
		double d=abs(pa-pb);
		if(d+ra-rb<EPS)cout<<-2<<endl;
		else if(d+rb-ra<EPS)cout<<2<<endl;
		else if(d-ra-rb<EPS)cout<<1<<endl;
		else cout<<0<<endl;
	}
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
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;
        double distance = sqrt( (xb - xa) * (xb - xa) + (yb - ya) * (yb - ya) );
        if(distance > ra + rb)
            cout << 0 << endl;
        else if(distance + rb <= ra)
            cout << 2 << endl;
        else if(distance + ra <= rb)
            cout << -2 << endl;
        else
            cout << 1 << endl;
    }
}

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

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

int judge(std::vector<float> ve){
	float 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<float> 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<iomanip>
#include<memory>
#include<array>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>

using namespace std;

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

  cin >> n;

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

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

      if ( pp > ra + rb )
        cout << 0 << endl;
      else if ( ra > pp + rb )
        cout << 2 << endl;
      else if ( rb > pp + ra )
        cout << -2 << endl;
      else
        cout << 1 << 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; 
         } 
         cout << endl; 
     }
    return 0; 
 }

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

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

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

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

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

using namespace std;

int n, out;
double x[2], y[2], r[2], dst;

int main()
{
	
	cin >> n;
	
	while(n--)
	{
		
		for( int i = 0; i < 2; i++)
		{
			cin >> x[i] >> y[i] >> r[i];
		}
		
		dst = sqrt( pow(x[1] - x[0], 2) + pow(y[1] - y[0], 2) );
		
		if( dst > r[0] + r[1] )
			out = 0;
		else if( dst > max(r[0], r[1]))
			out = 1;
		else 
			out = r[0] > r[1] ? 2 : -2;
		
		cout << out << endl;
		
	}
	
	return 0;
}