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>
#include<complex>
#include<cmath>
#include<map>
#define fs first
#define sc second
#define EPS (1e-10)
using namespace std;


typedef complex<double> P;
typedef pair<P,double> C;

int cpr(C a,C b){
  double d = abs(a.fs-b.fs);
  if(a.sc+b.sc + EPS < d)return -1;      //no intersection (outside)
  if(d + EPS < a.sc-b.sc)return 1;       //no intersection (inside,B in A)
  if(d + EPS < b.sc-a.sc)return 2;       //no intersection (inside,A in B)
  if(abs(a.sc+b.sc - d) < EPS)return -3; //one cross point (outside)
  if(abs(b.sc+d - a.sc) < EPS)return 3;  //one cross point (inside,B in A)
  if(abs(a.sc+d - b.sc) < EPS)return 4;  //one cross point (inside,A in B)
  return 0;                              //two cross point
}


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

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin>> ax >> ay >> ar >> bx >> by >> br;
    C a = C(P(ax,ay),ar), b = C(P(bx,by),br);
    int v = cpr(a,b);
    if(v==-1)cout <<  0 << endl;
    else if(v==1)cout << 2 << endl;
    else if(v==2)cout << -2 << endl;
    else cout << 1 << endl;
  }
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main(void) {
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        double x, y, r, X, Y, R;
        cin >> x >> y >> r >> X >> Y >> R;
        double d = sqrt((X-x) * (X - x) + (Y - y) * (Y - y));
        if (r >= d + R) {
            cout << 2 << endl;
        } else if (R >= d + r) {
            cout << -2 << endl;
        } else if (r - R <= d && d <= r + R) {
            cout << 1 << endl;
        } else {
            cout << 0 << endl;
        }
    }
    return 0;
}

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

using namespace std;

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

    cin >> num;
    for (int i = 0; i < num; i++) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        
        ra *= ra;
        rb *= rb;
        d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);

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

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

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

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

int main(){
	int n;
	cin>>n;
	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>

using namespace std;


struct circle{
  double x,y,r;
};

circle c[2];


bool isIn(circle a, circle b){
  return (b.x+b.r < a.x+a.r && b.y+b.r < a.y+a.r);
}

bool cross(circle a, circle b){
  double diff = (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
  return diff <= (a.r+b.r)*(a.r+b.r);
}
int solve(){

  if(isIn(c[0],c[1])) return 2;
  else if(isIn(c[1],c[0]))return -2;
  else if(cross(c[0],c[1])) return 1;
  else return 0;
}

int main(){

  int n;
  cin >> n;
  while(n--){
    for(int i = 0; i < 2; i++)
      cin >> c[i].x >> c[i].y >> c[i].r;

    cout << solve() << endl;
  }
  return 0;
}

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

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

	scanf("%d",&n);
	for(x=0;x<n;x++)
	{
		scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);

		d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));

		if(ra+rb<d)
		{
			printf("0\n");
		}
		else if(ra<rb&&d<rb-ra)
		{
			printf("-2\n");
		}
		else if(rb<ra&&d<ra-rb)
		{
			printf("2\n");
		}
		else
		{
			printf("1\n");
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    int n;
    cin >> n;
    rep(i, 0, n){
        int ans;
        double x[2], y[2], r[2];
        rep(j, 0, 2) cin >> x[j] >> y[j] >> r[j];
        double d = sqrt(pow(x[0] - x[1], 2) + pow(y[0] - y[1], 2));
        if(r[0] + r[1] < d) ans = 0;
        else if(r[0] > d + r[1]) ans = 2;
        else if(r[1] > d + r[0]) ans = -2;
        else  ans = 1;        
        cout << ans << endl;
    }
}

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

using namespace std;

int Calculate(double, double, double, double, double, double);
double GetDistance(double, double, double, double);

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

  cin >> n;
  for(i=0; i<n; ++i){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    cout << Calculate(xa, ya, ra, xb, yb, rb) << endl;
  }
  return 0;
}

int Calculate(double xa, double ya, double ra,
	      double xb, double yb, double rb){
  double r;
  r = GetDistance(xa, ya, xb, yb);
  if(ra > rb && ra >= r + rb) return 2;
  if(ra < rb && rb >= r + ra) return -2;
  if(r <= ra + rb) return 1;
  return 0;
}

double GetDistance(double xa, double ya, double xb, double yb){
  double x, y;
  x = xa - xb;
  y = ya - yb;
  return sqrt(x*x + y*y);
}