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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

int main(){
	long long 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 ab = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (ab + rb - ra <= -EPS) cout << 2 << endl;
		else if (ab + ra - rb <= -EPS) cout << -2 << endl;
		else if (ab - ra - rb >= EPS) cout << 0 << endl;
		else cout << 1 << endl;
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>

typedef long long ll;
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);
		double dist = sqrt(pow((xa-xb),2.0) + pow((ya-yb),2.0));

		int res=1;
		if(dist > ra + rb){
			res=0;
		}
		else if(dist <= ra+ rb){
			if(ra > dist +rb){
				res=2; 
			}
			else if(rb > dist + ra){
				res=-2;
			}
		}

		cout << res << endl;
	}
}

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

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

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;

	std::deque<int> number;

	for(int i = 0; i < dataSetNum; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dis = distance(xa, ya, xb, yb);
		//"0" if A and B do not overlap
		if(dis > ra + rb) std::cout << "0"; //number.push_back(0);
		//"2" if B is in A
		else if(ra > rb && (dis + rb <= ra) ) std::cout << "2"; //number.push_back(2);
		//"-2" if A is in B
		else if(rb > ra && (dis + ra <= rb) ) std::cout << "-2"; //number.push_back(-2);
		//"1" if circumference of A and B intersect
		else std::cout << "1";//number.push_back(1);
		std::cout << std::endl;
	}
	
	/*
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	*/
	return 0;
	}

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

struct Point{
    Point(void){
        x=y=r=0;
    }
    double x,y;
    double r;
};

double d(struct Point a,struct Point b){
    return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}

int main(void){
    int n;
    std::cin>>n;
    struct Point a,b;
    for(int i=0;i<n;i++){
        int judge;
        std::cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
        double d=d(a,b);
        if(d+b.r<a.r)
            judge=2;
        else if(d+a.r<b.r)
            judge=-2;
        else if(d<=a.r+b.r)
            judge=1;
        else
            judge=0;
        std::cout<<judge<<std::endl;
    }
    return 0;
}

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

int collision_detection(double x1, double y1, double x2, double y2, double r1, double r2){
	double d = ((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
	double sr = ((r1+r2)*(r1+r2));
	double dr = ((r1-r2)*(r1-r2));
	if( d > sr ){
		return 0;
	}else if( d <= sr && dr <= d){
		return 1;
	}else if(dr > d){
		return (r1>r2)? 2 : -2;
}
}

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

	cin >> n;
	for(int i=0 ; i<n ; i++){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		ans = collision_detection( xa, ya, xb, yb, ra, rb);
		cout << ans << endl;
	}
}

C++: #include<iostream>
#include<cmath>
using namespace std;
struct Circle { long double x, y, r; };
int solve(Circle c, Circle d) {
	long double dist = (c.x - d.x)*(c.x - d.x) + (c.y - d.y)*(c.y - d.y);
	dist = sqrt(dist);
	long double dist2 = d.r + dist;
	if (dist2 < c.r) { return 2; }
	long double dist3 = c.r + dist;
	if (dist3 < d.r) { return -2; }
	long double dist4 = c.r + d.r;
	if (dist4 < dist) { return 0; }
	return 1;
}
int main() {
	Circle a, b; int n; cin >> n;
	for (int i = 0; i < n;i++){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		cout << solve(a, b) << endl;
	}
	return 0;
}

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

int main()
{
	int n, t;
	double x1, y1, r1, x2, y2, r2;
	double d;

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);

		d = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
		if (d >= r1 + r2) t = 0;
		else if (d == r1 + r2 || d == fabs(r1 - r2)) t = 1;
		else if (d + r1 > r2) t = 2;
		else if (d + r2 > r1) t = -2;

		printf("%d\n", t);
	}

	return 0;
}

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

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

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


int n;
double xa, ya, ra;
double xb, yb, rb;


int solve(){
	double d = (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya);
	
	if((rb-ra)*(rb-ra) <= d && d <= (rb+ra)*(rb+ra)) return 1;
	if((rb+ra)*(rb+ra) < d) return 0;
	if(sqrtl(d) < (ra-rb)) return 2;
	if(sqrtl(d) < (rb-ra)) return -2;
	return 3;
}


int main(){
	cin >> n;
	int i = 0;
	while(cin >> xa >> ya >> ra >> xb >> yb >> rb, i < n){
		cout << solve() << endl;
		i++;
	}

	return 0;
}

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

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

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

int main()
{
	int n;
	std::cin >> n;
	
	while( n-- ){
	 	double x[2], y[2], r[2];
		for( int i = 0; i < 2; i++ ){
			std::cin >> x[i] >> y[i] >> r[i];
		}
		
		if( fabs( x[0] - x[1] ) > r[0] + r[1] ){
		 	puts("0");
		}
		else if( sqrt( pow( x[1] - x[0], 2 ) + pow( y[1] - y[0], 2 ) ) <= fabs( r[0] - r[1] ) ){
			std::cout << (  r[0] > r[1] ? 1 : -1 ) * 2 << std::endl;
		}
		else{
			puts("1");
		}
	}

 	return 0;
}