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 <math.h>
#include <string.h>
#include <iostream>

using namespace std;
// Problem:0023
int main()
{
	int n; double ax, ay, ar, bx, by, br, d, rPlus, rMinus;
	cin >> n;
	
	for (int i=0; i<n; i++) {
		cin >> ax >> ay >> ar >> bx >> by >> br;
		d = sqrt((ax - bx)*(ax - bx) + (ay - by)*(ay - by));
		rPlus = ar + br;
		rMinus = ar > br ? ar - br : br - ar;
		
		if (d > rPlus)
			cout << "0" << endl;
		else if (rPlus > d && d > rMinus)
			cout << "1" << endl;
		else if (d < rMinus) {
			if (ar > br)
				cout << "2" << endl;
			else
				cout << "-2" << endl;
		}
		
	}
	
	return 0;
}

C++: #include<iostream>
#include<cmath>
int main()
{
    int n;
    std::cin >> n;
    for (int i = 0; i < n; i++)
    {
        double xa, ya, ra, xb, yb, rb;
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = hypot(xa - xb, ya - yb);
        if (d < std::abs(ra - rb))
        {
            std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
        }
        else if (d <= ra + rb)
        {
            std::cout << 1 << std::endl;
        }
        else
        {
            std::cout << 0 << std::endl;
        }
    }
    return 0;
}

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

int main(){
	
	int num;
	
	std::cin >> num;  //dataset
	
	double xa,ya,ra;
	double xb,yb,rb;
	
	for(int i=0; i<num; ++i){
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		double length;  //a-b length;
		
		length = hypot(std::abs(xa-xb), std::abs(ya-yb));
		
		if(length > ra+rb){
			std::cout << 0 << std::endl;
		}else if(length + rb < ra){
			std::cout << 2 << std::endl; 
		}else if(length + ra < rb){
			std::cout << -2 << std::endl; 
		}else{
			std::cout << 1 << std::endl; 
		}
	}	
	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

int circle(double ra, double rb, double d){
	if((ra+rb)<d){
		return 0;
	}else{
		if(ra>(d+rb)){
			return 2;
		}else if(rb>(d+ra)){
			return -2;
		}else{
			return 1;
		}
	}
}

int main(){
	ios::sync_with_stdio(false);

	double a[2], b[2];
	double ra, rb;

	int n;
	scanf("%d", &n);

	while(n--){
		scanf("%lf %lf %lf %lf %lf %lf", &a[0], &a[1], &ra, &b[0], &b[1], &rb);

		double d=sqrt((b[0]-a[0])*(b[0]-a[0])+(b[1]-a[1])*(b[1]-a[1]));

		printf("%d\n", circle(ra, rb, d));
	}
}

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

int main(){
  int n;
  double ax,ay,ar,bx,by,br;
  double dis;

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> ar >> bx >> by >> br;

    dis = sqrt( (ax-bx)*(ax-bx) + (ay-by)*(ay-by) );
    if( dis < ar - br)cout << 2 << endl;
    else if( dis < br - ar)cout << -2 << endl;
    else if( dis < ar + br)cout << 1 << endl;
    else cout << 0 << endl;
  }
}

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

int main(){
  int n;
  double ax,ay,ar,bx,by,br;
  double dis;

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> ar >> bx >> by >> br;

    dis = sqrt( (ax-bx)*(ax-bx) + (ay-by)*(ay-by) );
    if( dis - ar + br < 1e-10)cout << 2 << endl;
    else if( dis - br + ar < 1e-10)cout << -2 << endl;
    else if( dis > ar + br)cout << 0 << endl;
    else cout << 1 << endl;
  }
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>
#include <vector>
#define P(a) ((a)*(a))
using namespace std;

int main(){
    double xa,ya,ra,xb,yb,rb,dist;
    int n;
    cin >> n;
    while(n--){
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        dist=sqrt(P(xb-xa)+P(yb-ya));
        if(ra>rb&&fabs(ra-rb)>dist) cout << "2" << endl;
        else if(ra<rb&&fabs(ra-rb)>dist) cout << "-2" << endl;
        else if(dist<=ra+rb&&fabs(ra-rb)<=dist) cout << "1" << endl;
        else cout << "0" << 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 - 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;
}