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 <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  int n;
  cin>>n;
  while(n--){
    double x,y;
    double ra,rb;
    cin>>x>>y>>ra;
    P a(x,y);
    cin>>x>>y>>rb;
    P b(x,y);
    double dist = abs(b-a);
    if(dist+ra <= rb){
      cout<<-2<<endl;
    }else if(dist+rb <= ra){
      cout<<2<<endl;
    }else if(ra+rb>=dist){
      cout<<-1<<endl;
    }else{
      cout<<0<<endl;
    }
  }
  return 0;
}

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

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

int main(){
	int n;
	scanf("%d",&n);
	for(int x=0;x<n;++x){
		circle a,b;
		scanf("%lf %lf %lf %lf %lf %lf",&a.x,&a.y,&a.r,&b.x,&b.y,&b.r);
		double d = sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
		if(d>a.r+b.r){
			cout<<0<<endl;
		}else if(a.r+d<b.r){
			cout<<-2<<endl;
		}else if(b.r+d<a.r){
			cout<<2<<endl;
		}else{
			cout<<1<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,r,n) for(int i=r;i<(int)n;i++)
using namespace std;
int in(){int x;cin>>x;return x;}
int n;
vector<int> a,b,c;

int main ()
{
	cin>>n;
	while(n--)
	{
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double half=sqrt((bx-ax)*(bx-ax)+(by-ay)*(by-ay));

		if(half-ar-br>0)
		{
			cout<<"0"<<endl;
		}
		else if(half+br<ar)cout<<2<<endl;
		else if(half+ar<br)cout<<-2<<endl;
		else cout<<1<<endl;

	}

	return 0;
}

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

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

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

struct P{
	double x, y;
};

struct Circle{
	P cp;
	double r;
};

double dist(Circle a, Circle b){
	double dx = a.cp.x - b.cp.x,
		dy = a.cp.y - b.cp.y;
	return sqrt(dx*dx+dy*dy);
}

double abs(double a){
	return (a>0)?(a):(-a);
}

int main(){
	int n;
	std::cin >> n;
	for(int i=0;i<n;i++){
		Circle a, b;
		std::cin >> a.cp.x >> a.cp.y >> a.r >> b.cp.x >> b.cp.y >> b.r;
		double d = dist(a, b),
			sum = a.r+b.r,
			diff = abs(a.r-b.r);
		if(d > a.r+b.r){//重ならない
			puts("0");
		}else if(diff <= d && d <= sum){//交わる
			puts("1");
		}else if(d < diff){//内包
			if(a.r > b.r){
				puts("2");
			}else{
				puts("-2");
			}
		}
	}
}

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

int main(void) {

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

  int n;
  
  double d,diff;
  int i;


  scanf("%d",&n);

  for(i=0;i<n;i++) {

    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);

    d=sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));

    diff=fabs(rb-ra);

    if(d>ra+rb) printf("0\n");

    else if(d<ra+rb && d>diff) printf("1\n");

    else if(ra>rb) printf("2\n");

    else if(rb>ra) printf("-2\n");

  }

  return 0;

}

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

using namespace std;

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

    return 0;
}

C++: #include <cmath>
#include <iostream>
using namespace std;
#define EPS 1e-12
int main()
{
    int n; cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = hypot(xa-xb, yb-yb);
        int res = 1;
        if (ra > rb) {
            if (d < ra - rb) res = 2;
            else if (d > ra + rb) res = 0;
        }
        else {
            if (d < rb - ra) res = -2;
            else if (d > ra + rb) res = 0;
        }
        cout << res << endl;
    }
    return 0;
}

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

using namespace std;

inline double sq(double x) {
  return x * x;
}

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

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

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        float xa, ya, ra;
        float xb, yb, rb;
        float d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); // distance of o1 and o2
        
        if ((d < ra - rb) && (ra > rb))
        {
            cout<<2<<endl;
        }
        else if ((d < rb - ra) && (ra < rb))
        {
            cout<<-2<<endl;
        }
        else if (d >= abs(ra - rb) && (d < ra + rb))
        {
            cout<<1<<endl;
        }
        else if (d > ra + rb)
        {
            cout<<0<<endl;
        }
//        else
//        {
//            cout<<1<<endl;
//        }
    }
}

int main()
{
    Solution();
    return 0;
}