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<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

double len(double xa, double ya, double xb, double yb) {
	double ans = 0;
	ans = sqrt(pow((xa - xb), 2) + pow((ya - yb), 2));
	return ans;
}

int main() {
	lint N;
	cin >> N;
	double xa, ya, ra, xb, yb, rb;
	rep(i, N) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (len(xa, ya, xb, yb) + ra < rb) {
			cout << -2 << endl;
		}
		else if (len(xa, ya, xb, yb) + rb < ra) {
			cout << 2 << endl;
		}
		else if (len(xa, ya, xb, yb) > ra + rb) {
			cout << 0 << enld;
		}
		else {
			cout << 1 << endl;
		}
	}
}

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-10) ans = 1;        
        cout << ans << endl;
    }
}

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

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

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

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

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

int main(){
	float x1, x2, x3;
	float y1, y2, y3;
	int n, i;

	scanf("%d", &n);

	for(i=0;i<n;i++){
		scanf("%f %f %f %f %f %f", &x1, &x2, &x3, &y1, &y2, &y3);

		if((y2-x2)*(y2-x2)+(y1-x1)*(y1-x1) > (x3 + y3)*(x3 + y3))
			printf("0\n");
		else if((y2-x2)*(y2-x2)+(y1-x1)*(y1-x1) < (x3 - y3)*(x3 - y3)){
			if((x3 -y3) >0)
				printf("2\n");
			else
				printf("-2\n");
		}
		else
			printf("1\n");
	}
	return 0;
}

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

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

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) number.push_back( 0 );
		//"2" if B is in A
		else if(ra > rb && (dis + rb <= ra) )  number.push_back( 2 );
		//"-2" if A is in B
		else if(rb > ra && (dis + ra <= rb) )  number.push_back( -2 );
		//"1" if circumference of A and B intersect
		else number.push_back( 1 );
	}
	for(int i = 0; i < dataSetNum; ++i){
		std::cout << number.front() << std::endl;
		number.pop_front();
	}
	return 0;
	}

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

int main(void){
	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 d = sqrt( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) );

		if( ra+rb < d )
			cout << 0 << endl;
		else if( d+rb < ra )
			cout << 2 << endl;
		else if( d+ra < rb )
			cout << -2 << endl;
		else
			cout << 1 << endl;

	}
	return 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(){
	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 << 1 << endl;
		else cout << 0 << endl;
	}
	return 0;
}