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 i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)>(ra+rb)*(ra+rb))
	{
	  if(xa < xb+rb && xa>xb-rb && ya < yb+rb && ya>yb-rb && ra > rb)
	    ans =2;
	  else if (xb < xa+ra && xb>xa-rb && yb < ya+rb && yb>ya-rb && rb > ra)
	    ans =-2;	
	  else
	    ans = 0;
	}
      else
	{
	  if(xa < xb+rb && xa>xb-rb && ya < yb+rb && ya>yb-rb && ra > rb)
	    ans =2;
	  else if (xb < xa+ra && xb>xa-rb && yb < ya+rb && yb>ya-rb && rb > ra)
	    ans =-2;
	  else
	    ans =-1;
	}

      cout<<ans<<endl;

    }

}

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

using namespace std;

int check(double *l, double *s);

int main()
{
	int n, ans;
	double a[3], b[3];	//[0]:x[1]:y[2]:r

	cin >> n;

	for (int i=0; i<n; i++)
	{
		cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];

		if(a[2] > b[2]) {		//aを大きい円、bを小さい円としたとき
			ans = check(&a[0], &b[0]);
		}
		else {					//bを大きい円、aを小さい円としたとき
			ans = check(&a[0], &b[0]);
			ans *= (ans == 2) ? -1 : 1;		//aがbの中にあるときの処理
		}

		cout << ans << endl;
	}

	return 0;
}

int check(double *l, double *s)	//円の重なり・内外を判定
{
	double d = (l[0]-s[0])*(l[0]-s[0]) + (l[1]-s[1])*(l[1]-s[1]);

	d = sqrt(d);

	if(d <= l[2]-s[2]) {	//小さい円が大きい円の内側にあるとき
		return 2;
	}
	else if(l[2]-s[2] < d && d < l[2]+s[2]) {	//円周が交わっているとき
		return 1;
	}
	else {
		return 0;	//外側にあるとき
	}
}

C++: #include<stdio.h>
#include<math.h>
#define EPS 1e-9
int n;
double xa,ya,ra,xb,yb,rb;

int main(){
	int i;
	scanf("%d",&n);
	
	for( i = 0;i < n;i++ ){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		//BがA中にあるか(境界ふくむ)
		if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) <= (ra-rb)*(ra-rb) && rb < ra )
			printf("2\n");
		//AがB中にあるか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) <= (ra-rb)*(ra-rb) && ra < rb )
			printf("-2\n");
		//AとBが交わっているか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) < (ra+rb)*(ra+rb) )
			printf("1\n");
		else
			printf("0\n");
	}
	return 0;
}

C++: #include <cmath>
#include <cstdio>
#define eps 1e-8
int n; long double xa, ya, ra, xb, yb, rb;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%Lf%Lf%Lf%Lf%Lf%Lf", &xa, &ya, &ra, &xb, &yb, &rb);
		long double dist = sqrtl((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if(dist >= ra + rb + eps) {
			printf("0\n");
		}
		else if(dist <= ra - rb - eps) {
			printf("2\n");
		}
		else if(dist <= rb - ra - eps) {
			printf("-2\n");
		}
		else  {
			printf("1\n");
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	double xa, ya, xb, yb, ra, rb;
	vector<int> Decision;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if ((ra+rb)*(ra + rb) < ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)))Decision.push_back(0);
		else if ((ra - rb)*(ra - rb) > ((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb))) {
			if (ra > rb)Decision.push_back(2);
			else Decision.push_back(-2);
		}
		else if (((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) <= (ra + rb)*(ra + rb))Decision.push_back(1);
	}
	for (int i = 0; i < Decision.size(); i++)cout << Decision[i] << endl;
	return 0;
}

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

int main(){
	double xa, ya, ra, xb, yb, rb;
	int n;
	cin >> n;
	while( n-- ){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double diff = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if( diff + rb <= ra ){
			cout << "2" << endl;
		}else if( diff + ra <= rb ){
			cout << "-2" << endl;
		}else if( diff <= ra + rb ){
			cout << "1" << endl;
		}else{
			cout << "0" << endl;
		}
	}
}

C++: #include<iostream>
#include<math.h>
using namespace std;

int main(){
	double x[2];
	double y[2];
	double r[2];
	double dist;
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dist = hypot(x[0] - x[1], y[0] - y[1]);
		if(r[0] > dist + r[1]){
			printf("2\n");
		}else if(r[1] > dist + r[0]){
			printf("-2\n");
		}else if(r[0] + r[1] < dist){
			printf("0\n");
		}else{
			printf("1\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double pitagoras(double x1,double y1,double x2,double y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

main(){
  int n;
  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 r=pitagoras(xa,ya,xb,yb);
    if(r+ra <= rb) printf("-2\n");
    else if(rb-ra > r && rb>ra) printf("2\n");
    else if(ra-rb > r && ra>rb) printf("1\n");
    else printf("0\n");
  }
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;


int main()
{
	int n;
	double  xa, ya, ra, xb, yb, rb;

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

		double dx = (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb);

		double xa_2 = xa*xa;
		double xb_2 = xb*xb;
		double ya_2 = ya*ya;
		double yb_2 = yb*yb;
		double ra_2 = ra*ra;
		double rb_2 = rb*rb;

		if (dx > (ra + rb)*(ra + rb)){
			cout << 0 << endl;
			continue;
		}

		if (xb_2 - xa_2 + yb_2 - ya_2 < rb_2 - ra_2){
			cout << -2 << endl;
			continue;
		}

		if (xa_2 - xb_2 + ya_2 - yb_2 < ra_2 - rb_2){
			cout << 2 << endl;
			continue;
		}

		cout << 1 << endl;
	}

	return 0;
}