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<bits/stdc++.h>
#define E 0.000000001
using namespace std;
int main(){
  int n;
  double xa,ya,ra,xb,yb,rb;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    double s=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)),r=ra+rb;
    if(s>r)cout<<"0"<<endl;
    else if(s+rb<ra) cout<<"2"<<endl;
    else if(s+ra<rb) cout<<"-2"<<endl;
    else cout<<"1"<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  ll n,i;
  ld xa,ya,ra,xb,yb,rb;
  ld dist;

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );//2????????????????????¢

    if(dist>ra+rb)//AB?????¢??????????????¨???
      cout<<"0"<<endl;
    else{
      if(rb<dist || ra<dist || ra==rb)//?????????????????¢??????????????????????????§??????
	cout<<"1"<<endl;
      else if(rb<ra && dist<ra)
	cout<<"2"<<endl;
      else if(ra<rb && dist<rb)
	cout<<"-2"<<endl;
    }
  }
}

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(ra - rb)){
      print("2");
    } else if (d < fabs(rb - ra)){
      print("-2");
    } else if (fabs(ra - rb) <= d && d <= ra + rb){
      print("1");
    } else {
      print("0");
    }
  }

  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(ya.at(i) - yb.at(i), 2));
		std::cout << check_intersection(ra.at(i), rb.at(i), distance) << std::endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
#define EPS 1e-9
int n;
double xa,ya,ra,xb,yb,rb;

int main(){
	int i;
	scanf("%d",&n);
	
	for( i = 0;i < n;i++ ){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		//BがA中にあるか(境界ふくむ)
		if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb)+EPS < (ra-rb)*(ra-rb) && rb < ra )
			printf("2\n");
		//AがB中にあるか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb)+EPS < (ra-rb)*(ra-rb) && ra < rb )
			printf("-2\n");
		//AとBが交わっているか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb)+EPS < (ra+rb)*(ra+rb) )
			printf("1\n");
		else
			printf("0\n");
	}
	return 0;
}

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

using namespace std;

typedef complex<double> P;

int main(void){
  int n; cin >> n;
  while(n--){
    double ra, rb;
    P a,b;
    cin  >> a.real() >> a.imag() >> ra >> a.real() >> b.imag() >> rb;
    double d = abs(a-b);
    int ans;
    if(d > ra + rb) ans = 0;
    else if(d + rb < ra) ans = 2;
    else if(d + ra < rb) ans = -2;
    else ans= 1;
    cout << ans << endl;
  }
  return 0;
}

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

int main()
{
	int n, t;
	double x1, y1, r1, x2, y2, r2;
	double d;

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);

		d = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
		if (d < (r2-r1)*(r2-r1)){
			if (r2 < r1) t = 2;
			else if (r2 > r1) t = -2;
		}else if (d >= (r1 + r2)*(r1 + r2)) t = 0;
		else if (d == (r1 + r2)*(r1 + r2) || d == (r2 - r1)*(r1 - r1)) t = 1;

		printf("%d\n", t);
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("-2");goto L;}
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("2");goto L;}
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        puts("0");
    L:;
        
    }
}