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 <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( ra - d > rb) {
				cout << 2 << endl;
		}
		else if( rb - d > ra) {
				cout << -2 << endl;
		}
		else
			cout << 1 << endl;
	}

	return 0;
}

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

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

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

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

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

int main(){
    int mod=1000000007;
    int n;
    int ans;
    double xa,ya,ra,xb,yb,rb;
    scanf("%d",&n);
    for (int i=0;i<n;i++) {
        scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
        double tmp=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        if ((tmp+rb)<=ra) {
            printf("2\n");
        } else if ((tmp+ra)<=rb) {
            printf("-2\n");
        } else if ((tmp)<(ra+rb)) {
            printf("1\n");
        } else {
            printf("0\n");
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    double a[3],b[3],dis,m;
    cin >>a[0]>>a[1]>>a[2]>>b[0]>>b[1]>>b[2];
    dis = (a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1]);
    if(dis>(a[2]+b[2])*(a[2]+b[2])) cout <<"0"<<endl;
    else if(dis<(a[2]-b[2])*(a[2]-b[2])){
      if(a[2]>b[2]) cout <<"2"<<endl;
      else cout <<"-2"<<endl;
    }
    else cout <<"1"<<endl;
    
  }
  return 0;
}

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

using namespace std;

void solve()
{
	int N;
	cin >> N;
	while(N--)
	{
		double x[2];
		double y[2];
		double r[2];
		for(int i = 0; i < 2; ++i)
		{
			cin >> x[i] >> y[i] >> r[i];
		}
		double dist = sqrt((x[1] - x[0]) * (x[1] - x[0]) + (y[1] - y[0]) * (y[1] - y[0]));
		if(dist > r[0] + r[1])
		{
			cout << "0" << endl;
		}
		else if(dist + r[0] < r[1])
		{
			cout << "-2" << endl;
		}
		else if(dist + r[1] < r[0])
		{
			cout << "2" << endl;
		}
		else
		{
			cout << "1" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

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

const double EPS = 1e-8;

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

double abs(double x) {
  return (x > 0 ? x : -x);
}

bool eq(double x, double y) {
  return abs(x - y) < EPS;
}

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

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

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

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

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((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 <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define rep2(i, n) for(int i = 1; i <= (int)n; ++i)
#define repit(it, t) for(__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++)

#define pb push_back
#define lb lower_bound
#define mp make_pair
#define ite iterator
#define ul unsigned long
#define ull unsigned long long
#define INF 1000000007
#define MOD 1000000007
#define EPS 1.0e-6
#define fs first
#define sd second

template<typename T>
bool elem(set<T> st, T val){
	return (st.find(val) != st.end());
}

template<typename T>
void printv(vector<T> vt){
    if(vt.size() == 0) return;
    rep(i, vt.size() - 1)
        cout << vt[i] << " ";
    cout << vt[vt.size() - 1] << endl;
}

typedef vector<int> vint;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef pair<int, int> pii;

double xa, ya, ra, xb, yb, rb;

#define db(x) ((x)*(x))

bool bina(){
    return (db(xa - xb) + db(ya - yb) < db(ra - rb));
}
    
int main(void){
    ios::sync_with_stdio(false);
    int t;
    cin >> t;
    while(t-- > 0){
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        if(bina()){
            cout << 2 << endl;
            continue;
        }
        swap(xa, xb);
        swap(ya, yb);
        swap(ra, rb);
        if(bina()){
            cout << -2 << endl;
            continue;
        }
        if(db(ra + rb) < db(xa - xb) + db(ya - yb))
            cout  << 0 << endl;
        else
            cout << 1 << endl;
    }
}