Go: package main

import (
        "fmt"
        "math"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                var ax, ay, ar, bx, by, br float64
                fmt.Scanf("%f %f %f %f %f %f", &ax, &ay, &ar, &bx, &by, &br)

                d := math.Sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay))
                if d <= ar + br {
                        if ar > br {
                                if ar > br + d {
                                        fmt.Println("2")
                                } else {
                                        fmt.Println("1")
                                }
                        } else {
                                if br > ar + d {
                                        fmt.Println("-2")
                                } else {
                                        fmt.Println("1")
                                }
                        }
                } else {
                        fmt.Println(0)
                }
        }
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  int n;
  cin >> n;
  REP(i, n) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
    //cout << xa << " " << ya << " " << ra << " " << xb << " " << yb << " " << rb << endl;
    if(abs(ra-rb) <= d && d <= ra+rb) cout << 1 << endl;
    else if(ra+rb < d) cout << 0 << endl;
    else if(ra > rb && d < ra-rb) cout << 2 << endl;
    else if(rb > ra && d < rb-ra) cout << -2 << endl;
    else assert(false);
  }

  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>

using namespace std;

const double eps=1e-10;

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 d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		double r=(ra+rb);

		if(d>r) cout<<0<<endl;
		else if(d+rb<ra) cout<<2<<endl;
		else if(d+ra<rb) cout<<-2<<endl;
		else cout<<1<<endl;
	}


	return 0;
}

C++: #include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

using namespace std;

int main(){
	int N;
	cin>>N;
	double xa,ya,ra,xb,yb,rb;
	REP(i,N){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if (d>ra+rb){
			cout<<0<<endl;
		}
		else if (fabs(ra-rb)<=d){
			cout<<1<<endl;
		}
		else if (ra>rb){
			cout<<2<<endl;
		}
		else{
			cout<<-2<<endl;
		}
	}
	return 0;
}

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

using namespace std;
typedef long long ll;

int main(){
    int n;
    string S;
    
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
        
        double xa,ya,ra,xb,yb,rb;
        
        scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
        
        double dis = sqrt(pow(xa-xb,2)+pow(ya-yb,2));
        
        if(ra > rb){
            if(dis+rb < ra)
                puts("2");
            else if(dis-rb > ra)
                puts("0");
            else
                puts("1");
        }else{
            if(dis+ra < rb)
                puts("-2");
            else if(dis-ra > rb)
                puts("0");
            else
                puts("1");
        }
    }
    
    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int num;
	double xa,xb,ya,yb,ra,rb;
	double dist;
	cin >> num;
	for( int i = 0; i < num; i++ ) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		dist = (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb);
		if( dist > ra + rb ) {
			cout << 0 << endl;
		}
		else if( dist < max(ra,rb) ) {
			if( ra > rb )
				cout << 2 << endl;
			else
				cout << -2 << endl;
		}
		else
			cout << 1 << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 2;

int main(){
    int n;
    cin >>n;
    REP(z, n){
        double x[N], y[N], r[N];
        REP(i, N) cin >>x[i] >>y[i] >>r[i];
        double dd = sqrt((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]));
        if((r[0] + r[1]) >= dd){
            if(dd + r[1] <= r[0]) cout <<2 <<endl;
            else if(dd  + r[0] <= r[1]) cout <<-2 <<endl;
            else cout <<1 <<endl;
        } else cout <<0 <<endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(u-r1 == r2 || ){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

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

int main()
{
	int n;
	std::cin >> n;
	
	while( n-- ){
	 	double x[2], y[2], r[2];
		for( int i = 0; i < 2; i++ ){
			std::cin >> x[i] >> y[i] >> r[i];
		}
		
		double d = sqrt( pow( x[1] - x[0], 2 ) + pow( y[1] - y[0], 2 ) );
		
		if( d > r[0] + r[1] ){
		 	puts("0");
		}
		else if( d < fabs( r[0] - r[1] ) ){
			std::cout << (  r[0] > r[1] ? 1 : -1 ) * 2 << std::endl;
		}
		else{
			puts("1");
		}
	}

 	return 0;
}