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 <stdio.h>
#include <math.h>
typedef struct En{
	double x,y,r;
};
int main(){
	En a,b;
	double dist,r;
	int n;
	scanf("%d",&n);
	while(n--){
		scanf("%lf%lf%lf%lf%lf%lf",&a.x,&a.y,&a.r,&b.x,&b.y,&b.r);
		dist = (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
		dist = sqrt(dist);
		//a.r = a.r*a.r;b.r = b.r*b.r;
		if(dist>a.r+b.r) printf("0\n");
		else if(a.r>b.r+dist) printf("2\n");
		else if(b.r>a.r+dist) printf("-2\n");
		else printf("1\n");
	}
	return 0;
}

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

using namespace std;

int main() {
    int n;
    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(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
        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 <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-ar-br<=0&&half-ar-br>min(-1*ar,-1*br))
		{
			cout<<1<<endl;
		}
		else
		{
			if(ar>br)
			{
				cout<<2<<endl;
			}
			else cout<<-2<<endl;
		}
	}

	return 0;
}

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

double dist(double dx, double dy){
	return sqrt(pow(dx, 2) + pow(dy, 2));
}

int main(){
	int N;
	double xa, ya, ra, xb, yb, rb;
	int res;
	double p_d;
	
	scanf("%d", &N);
	
	for(int i = 0; i < N; i++){
		scanf("%lf%lf%lf%lf%lf%lf", &xa, &ya, &ra, &xb, &yb, &rb);
		
		p_d = dist(xa - xb, ya - yb);
		
		if(ra + rb < p_d) res = 0;
		else if(p_d + ra < rb) res = -2;
		else if(p_d + rb < ra) res = 2;
		else res = 1;
		
		printf("%d\n", res);
	}
	
	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  float x1, y1, r1, x2, y2, r2;
  int n, ans;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    float r = r1 + r2;
    float d = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));

    if(d > r) ans = 0;
    else if(r1 > r2) {
      if(d + r2 < r1) ans = 2;
      else ans = 1;
    }
    else if(r1 < r2) {
      if(d + r1 < r2) ans = -2;
      else ans = 1;
    }
    else if(r1 = r2){
      ans = 1;
    }
    cout << ans << endl;
  }
    
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main (){

  int n,d[1000];
  
  double a[6],b,c;
  
  cin >>n;

  for(int j=0 ; j < n ; j++){
    
    for(int i=0 ; i < 6 ; i++){
      cin >> a[i];
    }
    
    c=(a[0]-a[3])*(a[0]-a[3])+(a[1]-a[4])*(a[1]-a[4]);
    b=sqrt(c);
    
    
    if( a[2]-b> a[5]){
      d[j]=2;
    }else if( a[5]-b > a[2] ){
      d[j]=-2;
    }else if( -b < a[5]-a[2] && a[5]-a[2] < b ){
      d[j]=0;
    }else{
      d[j]=1;
    }
    
  }

  for( int i=0 ; i < n ; i++){
    cout<<d[i]<<endl;
  }
  
  return 0;
  
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<iomanip>
using namespace std;
 
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
 
class Point{
    public:
        double x, y;
 
        Point(double x = 0, double y = 0): x(x), y(y) {}
 
        Point operator + (Point p){ return Point(x + p.x, y + p.y);}
        Point operator - (Point p){ return Point(x - p.x, y - p.y);}
        Point operator * (double a){ return Point(a * x, a * y);}
        Point operator / (double a){ return Point(x / a, y / a);}
 
        double abs(){ return sqrt(norm());}
        double norm(){ return x * x + y * y;}
 
        bool operator < (const Point &p) const{
            return x != p.x ? x < p.x : y < p.y;
        }
 
        bool operator == (const Point &p) const{
            return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
        }
};
 
class Circle{
    public:
        Point c;
        double r;
        Circle(Point c = Point(), double r = 0.0): c(c), r(r) {}
};
 
double getDistance(Point a, Point b){
    return (a - b).abs();
}
 
int main(){
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++){
        Circle a, b;
        cin >> a.c.x >> a.c.y >> a.r >> b.c.x >> b.c.y >> b.r;
        if(a.r > (b.r + getDistance(a.c, b.c))) cout << 2 << endl;
        else if(b.r > (a.r + getDistance(a.c, b.c))) cout << -2 << endl;
        else if(a.r + b.r < getDistance(a.c, b.c)) cout << 0 << endl;
        else cout << 1 << endl;
    }
    return 0;
}

C++: /**************************************************************************************************************
   *  Md. Abdulla Al Mamun (Nayon)
   *  ID: 1306001
   *  Session: 2013-2014
   *  Department of Computer Science and Engineering
   *  Begum Rokeya University, Rangpur (BRUR)
***************************************************************************************************************/
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <ios>
#include <set>
#include <map>

using namespace std;

#define PI acos(-1.0)
#define EPS 1e-9
#define INF 1 << 28
#define sq(a) ((a) * (a))
#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define ppb() pop_back()
#define mp(a, b) make_pair(a, b)
#define endl '\n'
#define MAX 100000
#define MOD 1000000007
#define dprint(expr) printf(#expr " = %lf\n", expr)

inline bool isEq(double a, double b){return (abs(a-b) < EPS);}
inline double NegZero(double x){if(isEq(x, -0.0))return +0.0;else return x;}

typedef long long ll;
typedef pair<int, int> pii;

//#define isValid(a, b) ((a >= 0 && a < b) ? 1 : 0)
//int dr[]  =  {0, -1, -1, -1,  0,  1, 1, 1};
//int dc[]  =  {1,  1,  0, -1, -1, -1, 0, 1};

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //ios_base::sync_with_stdio(false); cin.tie(NULL);
    double xa, ya, ra, xb, yb, rb;
    int t;
    cin >> t;
    while(t--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		int d = sqrt(sq(xa-xb) + sq(ya-yb));
		if(max(ra,rb) >= d+min(ra,rb)){
			if(ra >= rb)
				cout << "2" << endl;
			else if(rb > ra)
				cout << "-2" << endl;
			/*else
				cout << "1" << endl;*/
		}
		else if(d <= ra+rb)
			cout << "1\n";
		else
			cout << "0" << endl;
    }
    return 0;
}

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