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

inline double distance(std::array<double, 2> pa,std::array<double, 2> pb){
	return sqrt( (pa[0] - pb[0])*(pa[0] - pb[0]) + (pa[1] - pb[1])*(pa[1] - pb[1]) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;
	std::vector<int> number;
	for(int i = 0; i < dataSetNum; ++i){
		std::array<double, 2> pa[i];
		std::array<double, 2> pb[i];
		double ra[i],rb[i];

		std::cin >> pa[i][0] >> pa[i][1] >> ra[i] >> pb[i][0] >> pb[i][1] >> rb[i];
		//if A and B do not overlap
		if(distance(pa[i],pb[i]) > ra[i] + rb[i]) number[i] = 0;
		//if B is in A
		else if(ra[i] > rb[i] && distance(pa[i],pb[i]) + rb[i] <= ra[i]) number[i] = 2;
		//if A is in B,
		else if(rb[i] > ra[i] && distance(pa[i],pb[i]) + ra[i] <= rb[i]) number[i] = -2;
		//if circumference of A and B intersect
		else number[i] = 1;
	}
	for(int i = 0; i < dataSetNum; ++i) std::cout << number[i] << std::endl;
	return 0;
	}

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

using namespace std;

int main()
{
	int n;
	double x1, x2, y1, y2, r1, r2, u;
	while(cin>>n && n){
		while(n--){
			cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
			u = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
			
			if(r1+r2 > u){
				if(r1 > u && r2 > u){
					if(r1 == r2){
						cout << 1 << endl;
					} else if(r1 > r2){
						cout << 2 << endl;
					} else {
						cout << -2 << endl;
					}
				} else if(r1 > u && r2 <= u){
					cout << 2 << endl;
				} else {
					cout << -2 << endl;
				}
			} else if(r1+r2 == u){
				cout << 1 << endl;
			} else {
				cout << 0 << endl;
			}
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main()
{
	int N;
	cin>>N;
	while(N--){
		int ans;
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double x;
		x=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(x>(ar+br))ans=0;
		else if(abs(ar-br)<=x&&x<=(ar+br))ans=1;
		else if(x<abs(ar-br)&&ar>br)ans=2;
		else ans=-2;
		cout<<ans<<endl;
	}
    return 0;
}

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

struct Circle{
  double x, y, r;
};

int main() {
  int N;
  cin >> N;
  for(int i = 0; i < N; i++) {
    Circle a, b;
    cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
    double d = pow(a.x-b.x, 2.0) + pow(a.y-b.y, 2.0);
    if(d < pow(a.r-b.r, 2.0)) {
      if(a.r > b.r)      cout << 2 << endl;
      else if(a.r < b.r) cout << -2 << endl;
    } else if(d > pow(a.r + b.r, 2.0)) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
  return 0;
}

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 <vector>

inline float distance_pow2(float xa, float ya, float xb, float yb){
	return (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb);
}

inline int judge(std::vector<float> ve){
	float center_dis = distance_pow2(ve[0], ve[1], ve[3], ve[4]);
	float r_dis = (ve[2] + ve[5])*(ve[2] + ve[5]);
	if(center_dis > r_dis){
		return 0;	
	}else{
		if(center_dis > ve[2]*ve[2] && center_dis > ve[5]*ve[5]){
			return 1;
		}else{
			return ve[2] > ve[5] ? 2 : -2;
		}
	}
}

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>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(u-r1 == r2){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

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

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

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

using namespace std;

int main(void){
	int N;
	cin >> N;

	for(int i=0;i<N;i++){
		pair<double,double> p[2];
		double d,r[2];

		for(int j=0;j<2;j++){
			float x,y;
			cin >> x >> y >> r[j];
			p[j]=make_pair(x,y);
		}
		d=sqrt(pow(p[0].first-p[1].first,2)+pow(p[0].second-p[1].second,2));

		cout << (d<=r[0]+r[1]?d+r[1]>=r[0]?d+r[0]>=r[1]?1:-2:2:0) << endl;
	}

	return 0;
}