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 <iostream>
#include <cmath>
#include <math.h>
using namespace std;
 
double d(double x, double y, double z, double w){
    double ret;
    ret = pow(x - z , 2) + pow(y - w , 2);
    return sqrtf(ret);
}
 
int main(){
    int n;
    double x[2], y[2], r[2], dd;
    cin >> n;
    for(int i = 0;i<n;i++){
        cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
        dd = d(x[0], y[0], x[1], y[1]);
        if(dd > (r[0]+r[1])){
            cout << 0 << endl;
        }
        else if(dd + r[0] < r[1]){
            cout << -2 << endl;
        }
        else if (dd + r[1] < r[0]) {
            cout << 2 << endl;
        }
        else {
            cout << 1 << endl;
        }
    }
    return 0;
}

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

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

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

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

int main(){
	int n;
	cin>>n;

	for(int i = 0; i < n; i++){
		double xa,ya,ra,xb,yb,rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist)
			cout<<0<<endl;
		// ~üªðíé
		else if(((abs(ra-rb))*(abs(ra-rb))<dist&&(ra+rb)*(ra+rb)>dist))
			cout<<1<<endl;
		else if(abs(ra-rb)*abs(ra-rb)>dist){
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
		}
		else
			cout<<1<<endl;
	}

	return 0;
}

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

int main(){
	
	int num;
	
	std::cin >> num;  //dataset
	
	double xa,ya,ra;
	double xb,yb,rb;
	
	for(int i=0; i<num; ++i){
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		double length;  //a-b length;
		
		length = hypot(std::abs(xa-xb), std::abs(ya-yb));
		
		if(length > ra+rb){
			std::cout << 0 << std::endl;
		}else if(length + rb < ra){
			std::cout << 2 << std::endl; 
		}else if(length + ra < rb){
			std::cout << -2 << std::endl; 
		}else{
			std::cout << 1 << std::endl; 
		}
	}	
	return 0;
}

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

struct Circle {
    const double x, y, r;
    Circle(const double x, const double y, const double r) :x(x), y(y), r(r) {};
    ~Circle() = default;
    bool include(const Circle& C) const;
};

inline double distance(const Circle& A, const Circle& B);
int circles_intersection(const Circle& A, const Circle& B);

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

    std::cin >> n;
    for (u_int i = 0; i < n; ++i) {
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        Circle A(xa, ya, ra), B(xb, yb, rb);
        std::cout << circles_intersection(A, B) << std::endl;
    }

    return 0;
}

bool Circle::include(const Circle& C) const {
    const auto d = distance(*this, C);
    return (d*d < (r - C.r)*(r - C.r) && r > C.r);
}

inline double distance(const Circle& A, const Circle& B) {
    return std::sqrt((A.x - B.x)*(A.x - B.x) + (A.y - B.y)*(A.y - B.y));
}

int circles_intersection(const Circle& A, const Circle& B) {
    if (distance(A, B) > A.r + B.r)
        return 0;
    else if (A.include(B))
        return 2;
    else if (B.include(A))
        return -2;
    else
        return 1;
}

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

using namespace std;

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

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
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 len = sqrt(pow(xa-xb, 2.0) + pow(ya-yb, 2.0));

        if(len > ra + rb)
            cout << 0 << endl;
        else if(len >= abs(ra - rb))
            cout << 1 << endl;
        else if(ra > rb)
            cout << 2 << endl;
        else
            cout << -2 << endl;
    }
    return 0;
}

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

typedef complex<double> P;

int main(){
	int n;
	cin >> n;
	while(n--){
		double x,y,r,X,Y,R;
		cin >> x >> y >> r >> X >> Y >> R;
		double d = hypot(x-X,y-Y);
		if( d+R < r - 1e-9 ) {
			cout << 2 << endl;
		}else if(d+r < R - 1e-9) {
			cout << -2 << endl;
		}else if( d > r + R + 1e-9 ){
			cout << 0 << endl;
		}else{
			cout << 1 << endl;
		}
		
	}
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

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

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

		if(ra + rb < j)
		{
			cout << 0 << endl;
		}
		else if(j + rb < ra)
		{
			cout << 2 << endl;
		}
		else if(j + ra < rb)
		{
			cout << -2 << endl;
		}
		else if(j + rb >= ra)
		{
			cout << 1 << endl;
		}
	}
}

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;
}