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<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  cin>>n;
  rep(i,n){
    double xa,ya,ra,xb,yb,rb;
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    double dist=hypot(abs(xa-xb),abs(ya-yb));
    if(dist>ra+rb)cout<<0<<endl;
    else if(dist+rb<ra)cout<<2<<endl;
    else if(dist+ra<rb)cout<<-2<<endl;
    else cout<<1<<endl;
  }
}

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

using namespace std;

int main(void){
	double ax, ay, ar, bx, by ,br;
	double dist;
	double large, small;
	int n;
	int i;

	cin >> n;
	for(i=0;i<n;i++){
		cin >> ax >> ay >> ar >> bx >> by >> br;

		//calc distance between points
		dist = sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
		if(dist > ar + br){
			cout << 0 << endl;
		}else if(dist <= ar + br && dist >= fabs(ar - br) ){ //ツ静堋点ツづーツ篠敖づづつ「ツづゥ
			cout << 1 << endl;
		}else{
			if(max(ar, br) == ar){
				cout << 2 << endl;
			}else{
				cout << -2 << endl;
			}
		}
	}

	return 0;
}

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

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

C++: #include <iostream>
#define EPS (1e-10)
using namespace std;
int main(){
	int n, a;
	cin >> n;
	while(n--){
		double x[2], y[2], r[2], d2, t1, t2;
		for(int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i];
		d2 = (x[1]-x[0])*(x[1]-x[0]) - (y[1]-y[0])*(y[1]-y[0]);		//??????????£?????????¢
		t1 = (r[0]+r[1])*(r[0]+r[1]);
		t2 = (r[0]-r[1])*(r[0]-r[1]);

		if(d2 > t1 - EPS) a = 0;				// d > ra+rb: ???????????????
		else if(d2 >= t2 - EPS) a = 1;	// ra+rb >= d >= ra-rb: ?????????
		else  r[0] > r[1] ? a = 2 : a = -2;							// ra-rb > d : ??????
		cout << a << endl;
	}
	return 0;
}

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

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;
         d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        
        int ans;
         d<ra-rb ? ans=2 : d<rb-ra ? ans=-2 : d<=ra+rb ? ans=1 : ans=0;
         cout<<ans<<endl;
	}


	return 0;
}

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

int main(){
  int n,cnt=0;
  double xa,ya,ra,xb,yb,rb;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    if(xa+1*ra>=xb+1*rb) cnt++;
    if(ya+1*ra>=yb+1*rb) cnt++;
    if(xa+-1*ra<=xb+-1*rb) cnt++;
    if(ya+-1*ra<=yb+-1*rb) cnt++;
 


    if(xa+1*ra<xb-1*rb || ya+1*ra<yb-1*ra) cout<<0<<endl;
    else if(xa-1*ra>xb+1*rb || ya-1*ra>yb+1*ra) cout<<0<<endl;
    else if(cnt==4) cout<<2<<endl;
    else if(cnt==0) cout<<-2<<endl;
    else cout<<1<<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<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;
	}
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define rep2(i,from,to) for(int i=(from); i<(to); ++(i))
#define rep(i,to) rep2(i,0,to)
int main() {
	int n;
	cin >> n;
	while(n--) {
		double x[2], y[2], r[2];
		double EPS = 1e-10;
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		if(pow(x[1] - x[0], 2.0) + pow(y[1] - y[0], 2.0) - pow(r[1] + r[0], 2.0) > EPS) {
			cout << "0" << endl;
		} else {
			if(r[1] - r[0] - sqrt(pow(x[1] - x[0], 2.0) + pow(y[1] - y[0], 2.0)) > EPS) {
				cout << "-2" << endl;
			} else if(r[0] - r[1] - sqrt(pow(x[1] - x[0], 2.0) + pow(y[1] - y[0], 2.0)) > EPS) {
				cout << "2" << endl;
			} else cout << "1" << endl;
		}
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

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

int main(){
    int n;
    cin>>n;
    rep(loop,n){
        double x[2], y[2], r[2];
        rep(i,2)cin>>x[i]>>y[i]>>r[i];
        
        double direct = dir(x[0],y[0],x[1],y[1]);
        if(direct>r[0]+r[1])cout<<0<<endl;
        else if(direct+r[1]<=r[0])cout<<2<<endl;
        else if(direct+r[0]<=r[1])cout<<-2<<endl;
        else cout<<1<<endl;
    }
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r =pow(xb - xa, 2.0) + pow(yb - ya, 2.0);
		if (sqrt(r) > ra + rb) {
			cout << 0 << endl;
		}
		else if (sqrt(r) <ra-rb){
			cout << 2 << endl;
		}
		else if (sqrt(r) < rb - ra) {
			cout << -2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

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

int main(){
	int n;
	cin>>n;
	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(abs(ra-rb)>sqrt(pow(xa-xb,2)+pow(ya-yb,2))){if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#define EPS 0.000000001
using namespace std;

double X[2][60],Y[2][60],R[2][60];
int res[60];
int main(){
	int N;
	cin>>N;
	for(int i=1;i<=N;i++){
		for(int j=0;j<2;j++){
			cin>>X[j][i]>>Y[j][i]>>R[j][i];
		}
	}

	double re;
	for(int i=1;i<=N;i++){
		re=pow(X[0][i]-X[1][i],2)+pow(Y[0][i]-Y[1][i],2);
		if(re>pow(R[0][i]+R[1][i],2)){
			res[i]=0;
		}
		else if(re>pow(R[0][i]-R[1][i],2)){
			res[i]=1;
		}
		else if(R[0][i]>R[1][i]){
			res[i]=2;
		}
		else res[i]=-2;
	}
	for(int i=1;i<=N;i++){
		cout<<res[i]<<endl;
	}
	return 0;
}