Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var xa, ya, ra, xb, yb, rb float64
		fmt.Scan(&xa, &ya, &ra, &xb, &yb, &rb)
		// println(xa, ya, ra, xb, yb, rb)
		dis := math.Sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
		if dis + ra < rb {
			fmt.Println(-2)
		} else if dis + rb < ra {
			fmt.Println(2)
		} else if dis > rb + ra {
			fmt.Println(0)
		} else {
			fmt.Println(1)
		}
	}
}

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = hypot(xa - xb, ya - yb);
		if (d < abs(ra - rb))
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
		else if (d <= ra + rb)
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 0 << std::endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin >> n;
    while(n--){
        double x1,x2,y1,y2,r1,r2;
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
        double dist = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        if(r1>r2){
            if(dist<(r1-r2))    cout << "2\n";
            else if(dist>=(r1-r2)&&dist<=(r1+r2))   cout << "1\n";
            else    cout << "0\n";
        }
        else{
            if(dist<(r2-r1)) cout << "-2\n";
            else if(dist>=(r2-r1)&&dist<=(r2+r1))   cout << "1\n";
            else    cout << "0\n";
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

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

C++: #include <stdio.h>
#include <complex>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef complex<double> P;

int f(P p1, double r1, P p2, double r2) {
    const double d = abs(p1-p2);
    if (r1+r2 < d) return 0;
    if (r2+d < r1) return 2;
    if (r1+d < r2) return -2;
    return 1;
}

int main() {
    int T;
    scanf("%d", &T);
    while (T--) {
        double x1, y1, r1, x2, y2, r2;
        scanf("%lf%lf%lf", &x1, &y1, &r1);
        scanf("%lf%lf%lf", &x2, &y2, &r2);
        P p1(x1, y1), p2(x2, y2);
        printf("%d\n", f(p1, r1, p2, r2));
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<bitset>
#include<cmath>
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 a_b=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        double rab=ra+rb;
        int ans;
        if(a_b-rab>0)ans=0;
        else if(rb-(a_b+ra)>0)ans=-2;
        else if(ra-(a_b+rb)>0)ans=2;
        else ans=1;
        cout<<ans<<endl;
    }

}

C++: #include <bits/stdc++.h>

#define reps(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) reps(v, 0, n)
#define lep(v, n) reps(v, 1, n + 1)
#define rreps(v, f, l) for (int v = (l), v##_ = (f); v >= v##_; --v)
#define rrep(v, n) rreps(v, 0, n - 1)
#define rlep(v, n) rreps(v, 1, n)
#define show_a(a, size) rep(a##_it, size) std::cout << a[a##_it] << " \n"[a##_it == a##_it_ - 1];
#define show_v(v) show_a(v, v.size())
#define debug(x) std::cerr << #x << " = " << (x) << "\n";

using namespace std;

typedef long long int lint;
typedef complex<double> P;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int main()
{
  rep(i, in()){
    int res;
    double r1, r2;
    P p1, p2;
    cin >> p1.imag() >> p1.real() >> r1 >> p2.imag() >> p2.real() >> r2;
    if (abs(p1 - p2) > r1 + r2){
      res = 0;
    }
    else if (r2 + abs(p1 - p2) < r1){
      res = 2;
    }
    else if (r1 + abs(p1 - p2) < r2){
      res = -2;
    }
    else {
      res = 1;
    }
    cout << res << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define rep(i, n)      for (int i=0; i<int(n); i++)
#define rep3(i, s, n)  for (int i=int(s); i<int(n); i++)
#define rev_rep(i, n)  for (int i=int(n)-1; i>=0; i-=1)

int N;

int main() {
  cin >> N;
  rep(i, N) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double dist_p = (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb);
    int ans = 0;
    if (dist_p <= (ra+rb)*(ra+rb)) ans = 1;
    if (ra > rb && dist_p <= (ra-rb)*(ra-rb)) ans =  2;
    if (ra < rb && dist_p <= (rb-ra)*(rb-ra)) ans = -2;
    cout << ans << "\n";
  }
  return 0;
}

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

using namespace std;

int check(double xa,double ya,double ra,double xb,double yb,double rb){
  double dist = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
  double minr = min(ra,rb);
  if(ra+rb<dist){
    return 0;
  }else{
    if(ra>rb&&dist<rb){
      return 2;
    }else if(ra<rb&&dist<ra){
      return -2;
    }else{
      return 1;
    }
  }
}

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;
    cout << check(xa,ya,ra,xb,yb,rb) << endl;
  }
}

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

using namespace std;

int main(void) {
  int n;
  double xa, ya, ra, xb, yb, rb, d;
  cin >> n;

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

  return 0;
}

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

using namespace std;

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

    cin >> num;
    for (int i = 0; i < num; i++) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));

        if (d > ra + rb) 
            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++: #include <iostream>
#include <utility>
#include <cmath>
 
using namespace std;
 
int main(void){
    int N;
    cin >> N;
 
    for(int i=0;i<N;i++){
        pair<double,double> p[2];
        double d,r[2];
 
        for(int j=0;j<2;j++){
            float x,y;
            cin >> x >> y >> r[j];
            p[j]=make_pair(x,y);
        }
        d=sqrt(pow(p[0].first-p[1].first,2)+pow(p[0].second-p[1].second,2));
 
        cout << (d<=r[0]+r[1]?d+r[1]>=r[0]?d+r[0]>=r[1]?1:-2:2:0) << endl;
    }
 
    return 0;
}

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

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