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

using namespace std;

int main(){
  int n;
  double ax,ay,ar,bx,by,br,ans;
  cin >> n;
  while(n--){
  cin >> ax >> ay >> ar >> bx >> by >> br;
  if((sqrt(pow((ax-bx),2)+pow((ay-by),2))+br)<ar)ans=2;
  else if((sqrt(pow((ax-bx),2)+pow((ay-by),2))+ar)<br)ans=-2;
  else if((sqrt(pow((ax-bx),2)+pow((ay-by),2))+br)>=ar)ans=0;
  else if((sqrt(pow((ax-bx),2)+pow((ay-by),2))+ar)>=br)ans=1;
  cout << ans << endl;
  }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb;
  int n;
  cin >> n;
  while(n--){
    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(ra + rb <= d){
      cout << 0 << 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++: #include<stdio.h>
#include<math.h>

const double eps = 1e-10;

int main(void){
	int n;
	scanf("%d", &n);
	
	for(int i = 0; i < n; i++){
		double ax, ay, ar, bx, by, br;
		scanf("%lf %lf %lf %lf %lf %lf", &ax, &ay, &ar, &bx, &by, &br);
		double x = pow(ax-bx,2);
		double y = pow(ay-by,2);
		double d = sqrt(x+y);
		
		if(d>ar+br){
			puts("0");
		}else if(d == ar+br){
			puts("1");
		}else if(ar < br){
			puts("-2");
		}else if(br < ar){
			puts("2");
		}
	}
	
	return 0;
}

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

int main(){
	int n,ans;
	double xa,ya,ra;
	double xb,yb,rb;
	double ab;
	
	cin>>n;
	while(n--){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		ab=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		ans=1;
		if(ab>(ra+rb))ans=0;
		else if(ra>(ab+rb))ans=2;
		else if(rb>(ab+ra))ans=-2;
		cout<<ans<<endl;
		

	}

}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	double xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r =pow(xb - xa, 2.0) + pow(yb - ya, 2.0);
		if (sqrt(r) > ra + rb) {
			cout << 0 << endl;
		}
		else if (sqrt(r) <ra-rb){
			cout << 2 << endl;
		}
		else if (sqrt(r) < rb - ra) {
			cout << -2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>

int main(void) {
  int n, i, j, k;
  scanf("%d", &n);
  for(i = 0; i < n; ++i) {
    double xa, ya, ra, xb, yb, rb, d, rs, rd;
    scanf("%lf%lf%lf%lf%lf%lf", &xa, &ya, &ra, &xb, &yb,&rb);
    d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
    rs = (ra + rb) * (ra + rb);
    rd = (ra - rb) * (ra - rb);
    if(d > rs) printf("0\n");
    else if(rd <= d) printf("1\n");
    else if(ra > rb) printf("2\n");
    else printf("-2\n");
  }
  return 0;
}

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

int main(){
	int n;
	int out[1000];
	cin >> n;
	for(int i = 0; i < n; i++){
		double t;
		bool irekae = {false};
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		t = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if((ra+rb) < t){
			out[i] = 0;
			continue;
		}
		if(ra < rb){
			swap(xa,xb);
			swap(ya,yb);
			swap(ra,rb);
			irekae = {true};
		}
		if(t+rb < ra){
			if(irekae == true){
				out[i] = -2;
				continue;
			}
			else{
				out[i] = 2;
				continue;
			}
		}
		else{
			out[i] = 1;
		}
	}
	for(int i = 0; i < n; i++){
		cout << out[i] << endl;
	}
}

C++: //0023 Circles Intersection
//2Ì~ÌSÆ¼aª^¦çê½Æ«A»Ì2ÂÌ~ªðíÁÄ¢é©Aàï³êÄ¢é©AðíçÈ¢©ð»è¹æ
//È¨AAÆBª®SÉ¯êÌ~Å é±ÆÍÈ¢

//³Ä³ÄA0,0,1,0,2,1Ý½¢ÉêdÈéªÉÂ¢ÄÍÈÉà¾y³êÄ¢È¢Ì¾ª


#include<iostream>
#include<cmath>
using namespace std;

double Square(double x){return x*x;}
double Distance(double x, double y)
{
	return sqrt(Square(x) + Square(y) );
}

int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		double ax, bx, ay, by, ar, br;
		cin >> ax >> ay >> ar >> bx >> by >> br;

		//Ql@http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1251422802

		//à~ÌSðciA¼aðriAO~ÌSðcoA¼aðroÆ·éÆ
		//|ci-co|<=ro-ri@ÈçA®SÉàï·éEEEçµ¢
		double distance = Distance(ax-bx, ay-by);
		if(distance < br - ar)	//BªAðàï
			cout << -2 << endl;
		else if(distance < ar - br)	//AªBðàï
			cout << 2 << endl;
		//|ci-co| <= ar+br ËaÆbÍdÈé
		else if(distance <= ar+br)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

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;
		if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) <= (ra + rb) && abs(rb - ra) <= sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya))) {
			cout << "1" << endl;
		}
		else if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) > (ra + rb)) {
			cout << "0" << endl;
		}
		else if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) < abs(rb - ra) && rb > ra) {
			cout << "-2" << endl;
		}
		else if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) < abs(rb - ra) && ra > rb) {
			cout << "2" << endl;
			
		}
	}
	return 0;
}

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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define COUNT(i, n) for(int i = 1; i <= n; i ++)
#define ITER(c) __typeof((c).begin())
#define each(c, it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define ALL(c) c.begin(), c.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;

int main(void){
    int n; cin >> n;

    for(double xa, ya, ra, xb, yb, rb, d; n -- && cin >> xa >> ya >> ra >> xb >> yb >> rb; cout << ((ra + rb < d) ? 0:(d < rb - ra && ra < rb) ? -2:(d < ra - rb && rb < ra) ? 2:1) << endl)
        d = sqrt(pow(xb - xa, 2) + pow(yb - ya, 2));

    return 0;
}