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>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
        double sr = (ra + rb) * (ra + rb);
        double dr = (ra - rb) * (ra - rb);

        int res = 1;
        if (sr < d) {
            res = 0;
        } else if (d < dr) {
            res = (ra > rb) ? 2 : -2;
        }
        cout << res << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)

int main(void){
    int n;
    double x[2], y[2], r[2];
    cin >> n;
    rep(data, n) {
        rep(i, 2) cin >> x[i] >> y[i] >> r[i];
        double dist = sqrt(pow(y[1]-y[0], 2.0) + pow(x[1]-x[0], 2.0));

        if(r[0] > r[1] && dist < r[0]-r[1]) cout << 2 << endl;
        else if(r[1] > r[0] && dist < r[1]-r[0]) cout << -2 << endl;
        else if(dist > r[0] + r[1]) cout << 0 << endl;
        else cout << 1 << endl;
    }
}

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


using namespace std;

int main(){
  int datasets = 0;
  cin >> datasets;

  for(int i=0;i<datasets;i++){
    double xa,ya,ra,xb,yb,rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    //dis
    double dis = sqrt(pow(xa-xb, 2) + pow(ya-yb,2));
    
    if(abs(ra+rb) < dis){
      cout << 0 << endl;
      continue;
    }

    if(ra-rb > dis){
      cout << 2 << endl;
      continue;
    }

    if(rb-ra > dis){
      cout << -2 << endl;
      continue;
    }

    if(ra+rb > dis){
      cout << 1 << endl;
      continue;
    }
  }
}

C++: // AOJ 0023
#include<iostream>
#include<cmath>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const long double EPS = 1e-6;

long double sq(long double x) {
  return x * x;
}

long double abs(long double x) {
  return (x > 0 ? x : -x);
}
/*
bool eq(long double x, long double y) {
  return abs(x - y) < EPS;
}*/

long double dist(long double xa, long double ya, long double xb, long double yb) {
  return sq(xa - xb) + sq(ya - yb);
}

int main() {
  int n;
  cin >> n;
  REP(i, n) {
    long double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    long double d = sqrt(dist(xa, ya, xb, yb));
//    cout << d << endl;
    
    if (ra - rb > d + EPS) {
      cout << 2 << endl;
    } else if (rb - ra > d + EPS) {
      cout << -2 << endl;
    } else if (d > ra + rb + EPS) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

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;
		double dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist){
			cout<<0<<endl;
		}
		// SÔ£ª
		else if(!EQ(abs(ra-rb)*abs(ra-rb),dist)&&(abs(ra-rb))*(abs(ra-rb))<dist){
			cout<<1<<endl;
		}
		else{
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb){
				cout<<2<<endl;
			}
			else
				cout<<-2<<endl;
		}
	}


	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

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;
		double dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist)
			cout<<0<<endl;
		// ~üªðíé
		else if(EQ(abs(ra-rb)*abs(ra-rb),dist)||(abs(ra-rb))*(abs(ra-rb))<dist||EQ((ra+rb)*(ra+rb),dist))
			cout<<1<<endl;
		else if(abs(ra-rb)*abs(ra-rb)>dist){
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
		}
		else
			cout<<1<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


double xa, ya, ra, xb, yb, rb, d;
ll n;

int main(){
	cin >> n;
	REP(i, n){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (xa == xb&&ya == yb) d = 0;
		else if (xa == xb) d = abs(ya - yb);
		else if (ya == yb) d = abs(xa - xb);
		else d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
		if (d <= abs(ra - rb)){
			if (ra > rb){
				cout << 2 << endl;
			}
			else{
				cout << -2 << endl;
			}
			continue;
		}
		if (d <= ra + rb){
			cout << 1 << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
}

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

using namespace std;

int main()
{
	double x1,x2,y1,y2,r1,r2,d;
	int n,i;
	
	cin >> n ;
	
	for(i=0;i<n;i++)
	{
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2 ;
		
		d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		
		if(d-r1-r2>0.0)
			cout << "0" << endl;
		else if(r1-d-r2>0.0)
			cout << "2" << endl;
		else if(r2-d-r1>0.0)
			cout << "-2" << endl;
		else
			cout << "1" << endl;
	}
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	int time;
	cin>>time;
	double round[6];
	for(int i=0;i<time;++i){
		for(int i2=0;i2<6;++i2){
			cin>>round[i2];
		}
		if(pow(round[3]-round[0],2.0)+pow(round[4]-round[1],2.0)>pow(round[5]+round[2],2.0)){
			cout<<0<<endl;
		}else if(pow(round[3]-round[0],2.0)+pow(round[4]-round[1],2.0)+pow(round[5],2.0)<pow(round[2],2.0)){
			cout<<2<<endl;
		}else if(pow(round[3]-round[0],2.0)+pow(round[4]-round[1],2.0)+pow(round[2],2.0)<pow(round[5],2.0)){
			cout<<-2<<endl;
		}else{
			cout<<0<<endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
double d,r,s,z[6];
int n,i,j,a[50];
int main(){
	for(scanf("%d",&n);n--;){
		for(i=0;i<6;i++)
			scanf("%lf",z+i);
		r=z[2];
		s=z[5];
		d=hypot(*z-z[3],z[1]-z[4]);
		printf("%d\n",a[j++]=d>r+s?0:r>d+s?2:s>d+r?-2:1);
	}
	
	i=a[12];
	if(i==2)puts("");
	else if(i==-2)while(1);
	else if(i==1)return 1;
	return 0;
}