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>
using namespace std;
typedef long double LD;

int main() {
	int n;
	cin >> n;
	for (int x = 0;x < n;x++) {
		LD a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		LD od = ((d - a)*(d - a)) + ((e - b)*(e - b));
		LD rw = (c + f)*(c + f);
		LD id = (c - f)*(c - f);

	 if (rw <od)cout << 0 << endl;
		else if(od<id) {
			if (c < f)cout << -2 << endl;
			else cout << 2 << endl;
		}
		else cout << 1 << endl;
	}
	return 0;
}

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

int main(){
	int N;
	double xa,ya,ra,xb,yb,rb;
	
	scanf("%d",&N);
	while(N--){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		if(ra>rb+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))){
			printf("2\n");
		}else if(rb>ra+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))){
			printf("-2\n");
		}else if(ra==rb+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)) || rb==ra+sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

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

	return 0;
}

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

typedef pair<double,double>vec;

double norm(vec v1,vec v2){
    return (v1.first-v2.first)*(v1.first-v2.first)+(v1.second-v2.second)*(v1.second-v2.second);
}
int main()
{
    int n;
    cin>>n;
    while(n--){
        double x1,y1,r1,x2,y2,r2;
        cin>>x1>>y1>>r1>>x2>>y2>>r2;
        vec v1=make_pair(x1,y1);
        vec v2=make_pair(x2,y2);
        double dis=norm(v1,v2);
        if(dis>(r1+r2)*(r1+r2))
            cout<<0<<endl;
        else if(dis>(r1-r2)*(r1-r2)&&dis<(r1+r2)*(r1+r2)){
            cout<<1<<endl;
        }
        else if((r1-r2)*(r1-r2) > dis){
            if((r1-r2)>0){
                cout<<2<<endl;
            }
            else if((r1-r2)<0)cout<<-2<<endl;
        }
        else cout<<1<<endl;
    }
    return 0;
}

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

int main(){
	double xa,xb,ya,yb,ra,rb;
	int n;
	cin >> n;
	for( int i=0; i<n; i++ ){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double range = sqrt( (yb-ya)*(yb-ya)+(xb-xa)*(xb-xa) );
		int ret=1;
		if( rb > range+ra ){
			ret = -2;
		}else if( ra > range+rb ){
			ret = 2;
		}else if( range > ra+rb ){
			ret = 0;
		}
		cout << ret << 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 <cmath>
#include <iostream>
using namespace std;

int solve(double xa, double ya, double ra, double xb, double yb, double rb){
    double distance = sqrt(pow(xa - ya, 2) + pow(ya - yb, 2));
    if (distance > ra + rb) return 0;
    else if (distance < ra - rb) return 2;
    else if (distance < rb - ra) return -2;
    else return 1;
}

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

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

using namespace std;

double judge(double, double, double, double, double, double);

int main() {

	double xa, ya, ra, xb, yb, rb, N, ans;

	cin >> N;

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

	return 0;

}

double judge(double xa, double ya, double ra, double xb, double yb, double rb) {

	double d=sqrt(pow(xa-xb, 2)+pow(ya-yb, 2));

	if(ra+rb<d)
		return 0;
	else if(abs(ra-rb)>d)
		return ra>rb ? 2 : -2;
	else
		return 1;

}

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

using namespace std;

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

    cin >> n;
    while(n--) {
        int ret = 1;
        double d;

        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        d = sqrt(pow(xb-xa, 2) + pow(yb-ya, 2));
        if (ra + rb < d) {
            ret = 0;
        }else if (ra - rb > d) {
            ret = 2;
        }else if (rb - ra > d) {
            ret = -2;
        }

        cout << ret << endl;
    }
    return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb, sr, dr;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya - yb);
		float d = abs(comp);
		sr = ra + rb;
		if(ra < rb){
			dr = rb - ra;
		}
		else{
			dr = ra - rb;
		}
		if(d > sr){
			cout << "0" << endl;
		}
		else if(d < sr && dr < d){
			cout << "1" << endl;
		}
		else if(d < dr){
			if(rb < ra){
				cout << "2" << endl;
			}
			else if(ra < rb){
				cout << "-2" << endl;
			}
		}
	return 0;
	}
}

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

using namespace std;

void judge(double, double, double, double, double, double);

int main() {

	double xa, ya, ra, xb, yb, rb, N;

	cin >> N;

	for(int i=0; i<N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		judge(xa, ya, ra, xb, yb, rb);
	}

	return 0;

}

void judge(double xa, double ya, double ra, double xb, double yb, double rb) {

	double d=sqrt(pow(xa-xb, 2)+pow(ya-yb, 2));

	if(ra+rb<d)
		cout << "0" << endl;
	else if(ra+rb>d&&d>abs(ra-rb)||ra+rb==d)
		cout << "1" << endl;
	else if(ra-rb>d)
		cout << "2" << endl;
	else if(rb-ra>d)
		cout << "-2" << endl;

}