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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		double d = abs(ax-bx)*abs(ax-bx) + abs(ay-by)*abs(ay-by);
		d = sqrt(d);
		//printf("%f\n", d);
		if (d > ra+rb) puts("0");
		else if (d==0) {
			if (ra > rb) puts("2");
			else puts("-2");
		}
		else {
			// cross type
			if (d > ra && d > rb) puts("1");
			// inner type
			else if (d < ra && d > rb) puts("2");
			else if (d > ra && d < rb) puts("-2	");
		}
	}
	return 0;
}

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define F first
#define S second
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl

double a[6];

void solve(){
	double ab=sqrt((a[0]-a[3])*(a[0]-a[3])+(a[1]-a[4])*(a[1]-a[4]));
	if(ab>=a[2]+a[5])cout<<0<<endl;
	else if(ab+a[5]<=a[2])cout<<2<<endl;
	else if(ab+a[2]<=a[5])cout<<-2<<endl;
	else cout<<1<<endl;
	
}

int main(){
	li n;
	cin>>n;
	rin{
		rep(j,6)cin>>a[j];
		solve();
	}
	
	return 0;
}

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

int main(){
	int i, n, ans;
	double xa, xb, ra, rb, ya, yb;
	double d;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		if(fabs(ra-rb) > d){
			ans = (ra>rb)? 2 : -2;
		}else if(ra+rb < d){
			ans = 0;
		}else{
			ans = 1;
		}
		cout << ans << endl;
	}
	return 0;
}

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

using namespace std;

typedef long double ld;

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

int ans;

int main(void) {
    int N;
    scanf("%d", &N);

    while(N > 0) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        ans = 1;

        ld dist = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));

        if(dist + rb < ra) {
            ans = 2;
        } else if(dist + ra < rb) {
            ans = -2;
        } else if(dist > ra + rb) {
            ans = 0;
        }
        printf("%d\n", ans);
        N--;
    }

    return 0;
}

C++: #include <stdio.h>
#include <math.h>
  int main(){
    int n,i;
    double xa,ya,ra,xb,yb,rb;
    scanf("%d",&n);
     for(i=0;i<n;i++){
       scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
       double dis=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);   
       dis = pow(dis,0.5);
       if(dis>ra+rb){
printf("%d\n",0);
continue;
}else if(dis<ra+rb && dis>fabs(ra-rb)){
printf("%d\n",1);
continue;
}else if(dis<fabs(ra-rb)){
	if(ra>rb){
printf("%d\n",2);
	}else{
		printf("%d\n",2);
	}
}

}
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(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}}
	}
	return 0;
}

C++: #include <iostream>
#define EPS 1+(1e-10)
using namespace std;
int main(){
	int n, a;
	cin >> n;
	while(n--){
		double x[2], y[2], r[2], d2;
		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]);	//??????????£?????????¢
		if(d2*EPS > (r[0]+r[1])*(r[0]+r[1]) * EPS) a = 0;			// d > ra+rb: ???????????????
		else if(d2*EPS >= (r[0]-r[1])*(r[0]-r[1]) * 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<stdio.h>
#include<math.h>

int main()
{
	int n;
	std::cin >> n;
	
	while( n-- ){
	 	double x[2], y[2], r[2];
		for( int i = 0; i < 2; i++ ){
			std::cin >> x[i] >> y[i] >> r[i];
		}
		
		double d = sqrt( pow( x[1] - x[0], 2 ) + pow( y[1] - y[0], 2 ) );
		
		if( d > r[0] + r[1] ){
		 	puts("0");
		}
		else if( d <= fabs( r[0] - r[1] ) ){
			std::cout << (  r[0] > r[1] ? 1 : -1 ) * 2 << std::endl;
		}
		else{
			puts("1");
		}
	}

 	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

double getDistance(double xa, double ya, double xb, double yb) {
    return sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
}

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

C++: //52
#include<iostream>

using namespace std;

#define S(X) ((X)*(X))

int main(){
  int N;
  cin>>N;
  while(N--){
    double x[2],y[2],r[2];
    for(int i=0;i<2;i++){
      cin>>x[i]>>y[i]>>r[i];
    }
    double ds=S(x[0]-x[1])+S(y[0]-y[1]);
    int ans;
    if(r[0]>r[1]&&ds<S(r[0]-r[1])){
      ans=2;
    }else if(r[1]>r[0]&&ds<S(r[1]-r[0])){
      ans=-2;
    }else if(ds<S(r[0]+r[1])){
      ans=1;
    }else{
      ans=0;
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      double d = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
      if(d  <= (ra-rb)*(ra-rb))
	ans = 2;
      else if (d  <= (rb-ra)*(rb-ra))
	ans =-2;
      else if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)>(ra+rb)*(ra+rb))
	ans = 0;
      else
	    ans =-1;

      cout<<ans<<endl;

    }

}

C++: #include <iostream>

int check_intersection(const double xa, const double ya, const double ra,
                            const double xb, const double yb, const double rb)
{
    double distance = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
    if(distance < ra * ra || distance < rb * rb){
        if(ra > rb)
            return 2;
        else
            return -2;
    }
    else if(distance > (ra + rb) * (ra + rb))
        return 0;
    else return 1;
}

int main ()
{
    double xa, ya, ra, xb, yb, rb;
    u_int N;
    
    std::cin >> N;
    for(u_int i = 0; i < N; ++i){
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        std::cout << check_intersection(xa, ya, ra, xb, yb, rb) << std::endl;
    }
    
    return 0;
}