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>
#include<algorithm>
using namespace std;
int main(void){
  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((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
    if(d < ra - rb) cout << "2" << endl;
    else if(d < rb - ra) cout << "-2" << endl;
    else if(d > ra + rb) cout << "0" << endl;
    else if(d >= ra - rb) cout << "1" << endl;
  }

}

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++: #include <iostream>
#include <cmath>

double distance(double x1, double y1, double x2, double y2){
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}

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

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)
 
double dir(double x1, double y1, double x2, double y2){
    return sqrt(abs(x1-x2)*abs(x1-x2) + abs(y1-y2)*abs(y1-y2));
}
 
 
int main(){
    int n;
    cin>>n;
    rep(loop,n){
        double x[2], y[2], r[2];
        rep(i,2)cin>>x[i]>>y[i]>>r[i];
         
        double direct = dir(x[0],y[0],x[1],y[1]);
        if(direct>r[0]+r[1])cout<<0<<endl;
        else if(direct+r[1]<=r[0])cout<<2<<endl;
        else if(direct+r[0]<=r[1])cout<<-2<<endl;
        else cout<<1<<endl;
    }
}

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

int main(void){
	int n = 0;
	float xa, ya, ra, xb, yb, rb;
	float d =0.0;
	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%f %f %f %f %f %f",
			&xa, &ya, &ra, &xb, &yb, &rb);
		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));

		if(d > ra+rb){
			puts("0");
		}else if(ra >= d+rb){
			puts("2");
		}else if(rb >= d+ra){
			puts("-2");
		}else{
			puts("1");
		}
	}
	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<fabs(ra-rb)){
	if(ra>rb){
printf("%d\n",2);
	}else{
		printf("%d\n",2);
	}
}else{
	printf("%d\n",1);
}
}
return 0;
}

C++: /* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 
                                                           
*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define print(x) cout << x << '\n'
#define Fi first
#define Se second

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define DEPS(i, a, n) for (int i = (a); i >= n; i--)
#define DEP(i, n) for (int i = (n); i >= 0; i--)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool is_uruu(int y) {return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;}
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}

/* }}} */

#define sq(x) ((x) * (x))

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;

  while (n--){
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(sq(xa - xb) + sq(ya - yb));

    if (d < fabs(rb - ra)){
      print("2");
    } else if (d < fabs(ra - rb)){
      print("-2");
    } else if (fabs(ra - rb) <= d && d <= ra + rb){
      print("1");
    } else {
      print("0");
    }
  }

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

typedef struct{
  double x,y,r;
}Circle_t;


inline double dist(Circle_t a, Circle_t b){
  return sqrt( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) );
}

int main(){

  int n;
  Circle_t a,b;

  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;

    if( a.r + b.r < dist(a,b) ) cout << 0 << endl;

    else if(a.r-b.r > dist(a,b)) cout << 2 << endl;

    else if(b.r-a.r > dist(a,b)) cout << -2 << endl;

    else cout << 1 << endl;

  }

  return 0;
}

C++: #include <iostream>
using namespace std;
 
struct circle{
    double x;
    double y;
    double r;
};
 
int judge_intersection(circle ca, circle cb){
    double dis2 = (ca.x - cb.x) * (ca.x - cb.x)
                + (ca.y - cb.y) * (ca.y - cb.y);
    if((ca.r > cb.r) && ((ca.r - cb.r) * (ca.r - cb.r) > dis2)){
        return 2;
    } else if((cb.r > ca.r) && ((ca.r - cb.r) * (ca.r - cb.r) > dis2)){
        return -2;
    } else if((ca.r + cb.r) * (ca.r + cb.r) >= dis2){
        return 1;
    } else {
        return 0;
    }
}
 
int main()
{
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        circle ca, cb;
        cin >> ca.x >> ca.y >> ca.r
            >> cb.x >> cb.y >> cb.r;
        cout << judge_intersection(ca, cb) << endl;
    }
    return 0;
}