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

using namespace std;

double distance( double y1, double x1, double y2, double x2){
  return sqrt( (y1 - y2) * (y1 - y2) + (x1 - x2) * (x1 - x2));
}
int main(){
  int q;
  cin >> q;
  while(q--){
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = distance( ya, xa, yb, xb);

    int ret = 0;
    if( d < ra - rb) ret = 2;
    else if( d < rb - ra) ret = -2;
    else if( d == ra + rb || d == ra - rb) ret = 1;

    cout << ret << endl;
  }
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
 
 double abs(double x)
 {
   if(x<0) return -x;
   else return x;       
 }
  
 int main()
 {
   int n;
   int result;
   cin>>n;
   double xa,ya,ra,xb,yb,rb;
   while(n--)
   {
     cin>>xa>>ya>>ra>>xb>>yb>>rb;
     double dis=sqrt(pow(yb-ya,2)+pow(xb-xa,2));
     if(dis>ra+rb) result=0;
     else if(dis>abs(ra-rb)) result=1;
     else
     {
       if(dis+ra<=rb) result=-2;
       else if(dis+rb<=ra) result=2;    
     }        
   }
   cout<<result<endl;
   //while(1);      
   return 0;    
 }

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.ci", "r", stdin);
	string str = "";
	int n;

	getline (cin, str );
	stringstream ssn(str);
	ssn >> n;

	int i;
	for (i = 0; i < n; ++i){
		getline (cin, str );
		vector <double> cx (2, 0.0);
		vector <double> cy (2, 0.0);
		vector <double> r  (2, 0.0);
		stringstream ss(str);
		ss >> cx[0] >> cy[0] >> r[0] >> cx[1] >> cy[1] >> r[1];

		double d = sqrt ( (cx[1] - cx[0])*(cx[1] - cx[0]) + (cy[1] - cy[0])*(cy[1] - cy[0]) );
		if (d >= 0 && d < fabs (r[1] - r[0])){
			if (r[0] > r[1]){ // B in A
				cout << "2" << endl;
			}else if (r[0] < r[1]){ // A in B
				cout << "-2" << endl;
			}else{ // if (r[0] == r[1])
				cout << "1" << endl;
			} // end if
		}else if ( ( d >= fabs(r[1] - r[0]) ) && ( d <= r[0] + r[1] ) ){
			cout << "1" << endl;
		}else{
			cout << "0" << endl;
		} // end if
	} // end for
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

using namespace std;

int n, out;
double x[2], y[2], r[2], dst;

int main()
{
	
	cin >> n;
	
	while(n--)
	{
		
		for( int i = 0; i < 2; i++)
		{
			cin >> x[i] >> y[i] >> r[i];
		}
		
		dst = sqrt( pow(x[1] - x[0], 2) + pow(y[1] - y[0], 2) );
		
		if( dst > r[0] + r[1] )
			out = 0;
		else if( abs(r[0] + r[1]) > dst && dst > abs(r[0] - r[1]))
			out = 1;
		else 
			out = r[0] > r[1] ? 2 : -2;
		
		cout << out << endl;
		
	}
	
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main(void){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
	double x[2],y[2],r[2],h;
		for(int j=0;j<2;j++){
			cin>>x[j]>>y[j]>>r[j];
		}
		h=hypot(abs(x[0]-x[1]),abs(y[0]-y[1]));
		if(r[1]+h<r[0])puts("2");
		else if(r[0]+h<r[1])puts("-2");
		else if(h<=r[0]+r[1])puts("1");
		else puts("0");
	}
}

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

using namespace std;
int main(){
	int N;
	cin >> N;
	for(int i = 0;i < N;i++){
		double xa, ya, ra;
		double xb, yb, rb;
		double d, R;

		cin >> xa >> ya >> ra;
		cin >> xb >> yb >> rb;

		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		R = fabs(ra-rb);
		if(ra+rb < d){
			cout << "0" << endl;
		}
		else if(ra+rb == d || (R < d && d < ra+rb)){
			cout << "1" << endl;
		}
		else if(R >= d && ra > rb){
			cout << "2" << endl;
		}
		else if(R >= d && ra < rb){
			cout << "-2" << endl;
		}

	}

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

	return 0;
}

C++: #include<iostream>
#include<math.h>
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 rsum = (ra+rb)*(ra+rb), rdiff = ra-rb;
        double cntr_dst = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if(rdiff>0 && rdiff*rdiff>cntr_dst){
            cout << 2;
        }else if(rdiff<0 && rdiff*rdiff>cntr_dst){
            cout << -2;
        }
        else if(rsum>cntr_dst && cntr_dst>fabs(rdiff)){
            cout << 1;
        }
        else if(rsum<cntr_dst){
            cout << 0;
        }
        cout << endl;
    }
    return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb,d;
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    // BがAの中にあるとき
    if(ra>rb && d < fabs(ra + rb)){
      cout << 2 << endl;
    } // AがBの中にあるとき
    else if(ra<rb && d < fabs(ra + rb)){
      cout << -2 << endl;
    } // 円周が交わってる
      else if(d == fabs(ra + rb)){
      cout << 1 << endl;
    } // 重なってないとき
      else if(d >  fabs(ra + rb)){
      cout << 0 << endl;
    }
  }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  double n,xa,ya,ra,xb,yb,rb,d,X,Y;
  cin >> n ;
  for(int i=0;i<n;i++){
  cin >> xa >> ya >> ra >> xb >> yb >> rb ;
  X=(xa-xb)*(xa-xb);
  Y=(ya-yb)*(ya-yb);
  d=sqrt(X+Y);

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

  return 0;
}