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<cmath>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        float x[2], y[2], r[2];
        
        for(int j = 0; j < 2; j++)
            cin >> x[j] >> y[j] >> r[j];
        
        // 2??????????????????????????¢
        float d = sqrt((x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0]));
        
        int ans;
        // ??????????????¢??¨???B?????????????????????A????????????????°?????????´?????????B??????A????????¨?????????
        if(d + r[0] < r[1])
            ans = -2;
        // ?????????
        else if(d + r[1] < r[0])
            ans = 2;
        // 2?????????????????????????????????????????¢??????????°?????????´??????2????????????????????£?????????
        else if(d < r[0]+ r[1])
            ans = 1;
        // ?????????
        else
            ans = 0;
        cout << ans << endl;
    }
}

C++: #include <cmath>
#include <cstdio>
int n; double xa, ya, ra, xb, yb, rb;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%lf%lf%lf%lf%lf%lf", &xa, &ya, &ra, &xb, &yb, &rb);
		double dist = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if(dist >= ra + rb) {
			printf("0\n");
		}
		else if(dist <= ra - rb) {
			printf("2\n");
		}
		else if(dist <= rb - ra) {
			printf("-2\n");
		}
		else  {
			printf("1\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  int n; scanf("%d",&n);
  while(n --> 0){
    P c1, c2; double r1, r2;
    scanf("%lf%lf%lf%lf%lf%lf",&c1.real(),&c1.imag(),&r1,&c2.real(),&c2.imag(),&r2);
    double dist = abs(c1 - c2);
    if(r1 > dist + r2) puts("2");
    else if(r2 > dist + r2) puts("-2");
    else if(r1 + r2 > dist) puts("1");
    else puts("0");
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		long double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		long double d = hypot(xa - xb, ya - yb);
		if (d < std::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( void )
{
  int n,t;
  double xa,ya,ra,xb,yb,rb,d;
  cin >> n;
  for( int i=0; i<n; i++ ){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    d = sqrt( (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya) );
    if( ra + rb < d ) t=0;
    else if( d + rb < ra ) t=2;
    else if( d + ra < rb ) t=-2;
    else t=1;
    cout << t << endl;
  }
  return 0;
}

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

int check_intersection(const double ra, const double rb, const double distance){
	if(distance > (ra + rb)){
		return 0;
	}else if(ra > rb){
		return ((distance + rb) < ra) ? 2 : 1;
	}else{
		return ((distance + ra) < rb) ? -2 : 1;
	}
}

int main(){
	int data_set;
	std::cin >> data_set;
	std::vector<double> xa(data_set), ya(data_set), ra(data_set), xb(data_set), yb(data_set), rb(data_set);
	for(int i = 0; i < data_set; ++i){
		std::cin >> xa[i] >> ya[i] >> ra[i] >> xb[i] >> yb[i] >> rb[i];
	}
	double distance;
	for(int i = 0; i < data_set; ++i){
		distance = sqrt(pow(xa.at(i) - xb.at(i), 2) + pow(yb.at(i) - yb.at(i), 2));
		std::cout << check_intersection(ra.at(i), rb.at(i), distance) << std::endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
  double xa, ya, ra, xb, yb, rb;
  int n, ans;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
    double r = ra + rb;
    
    if(d > r){
      ans = 0;
    }
    else if(d <= r && d >= fabs(ra - rb)){
      ans = 1;
    }else{
      if(max(ra,rb) == ra) ans = 2;
      else ans = -2;
    }
    cout << ans << endl;
  }
}

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

typedef complex<double> Point;

#define X real()
#define Y imag()

int n;
Point ps[2];
double rs[2];

int main() {
  scanf("%d", &n);
  while (n--) {
    for (int i=0; i<2; i++) {
      double x, y;
      scanf("%lf%lf%lf", &x, &y, &rs[i]);
      ps[i] = Point(x, y);
    }

    Point dp = ps[0]-ps[1];
    double d = sqrt(dp.X*dp.X+dp.Y*dp.Y);
    if (d > rs[0]+rs[1]) puts("0");
    else if (rs[1] > rs[0] + d) puts("-2");
    else if (rs[0] > rs[1] + d) puts("2");
    else puts("1");
  }
}

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

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(pow(xa-xb,2)+pow(ya-yb,2));
		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;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;

int main(){
    int n;
    string S;
    
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
        
        double xa,ya,ra,xb,yb,rb;
        
        scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
        
        double dis = sqrt(pow(xa-xb,2)+pow(ya-yb,2));
        
        if(ra > rb){
            if(dis+rb < ra)
                puts("2");
            else if(dis-rb > ra)
                puts("0");
            else
                puts("1");
        }else{
            if(dis+ra < rb)
                puts("2");
            else if(dis-ra > rb)
                puts("0");
            else
                puts("1");
        }
    }
    
    return 0;
}

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