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 <bits/stdc++.h>
using namespace std;

#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using pii = pair<int, int>;
using vi = vector<int>;
using lint = long long;

const int inf = 1001001001;
const lint linf = 1001001001001001001ll;
const double eps = 1e-9;
const double EPS = 1e-9;
const int mod = 1e9 + 7;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};

template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; }
template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; }
template<typename T> inline void print(const vector<T> &v, string s = " ")
{ if (!v.size()) puts(""); rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); }
inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }
inline lint in() { lint x; std::cin>>x; return x; }

#define equals(a, b) (fabs(a - b) < EPS)

struct Point {
  double x, y;

  Point() {}
  Point(double x, double y) :x(x), y(y){}

  Point operator+(Point p) { return Point(this->x + p.x, this->y + p.y); }
  Point operator-(Point p) { return Point(this->x - p.x, this->y - p.y); }
  Point operator*(double k){ return Point(this->x * k, this->y * k); }
  Point operator/(double k){ return Point(this->x / k, this->y / k); }

  double norm() { return x * x + y * y; }
  double abs()  { return sqrt(norm()); }
};

struct Circle {
  double r;
  Point c;
  Circle() {}
  Circle(Point c, double r) :c(c), r(r){}
  Circle(double x, double y, double r) :c(Point(x, y)), r(r){}
};

double norm(Point a) {
  return a.x * a.x + a.y * a.y;
}

double abs(Point a) {
  return sqrt(norm(a));
}

static const int ICC_SEPARATE = 0;
static const int ICC_CIRCUMSCRIBE = 1;
static const int ICC_INTERSECT = 1;
static const int ICC_INSCRIBE = 1;
static const int ICC_CONTAIN = 2;

int intersectCC(Circle c1, Circle c2){
  int f = 1;
  if(c1.r < c2.r) { f *= -1; swap(c1, c2); }

  double d = abs(c1.c - c2.c);
  double r = c1.r + c2.r;

  if(equals(d, r)) return ICC_CIRCUMSCRIBE;
  if(d > r) return ICC_SEPARATE;
  if(equals(d + c2.r, c1.r)) return ICC_INSCRIBE;
  if(d + c2.r < c1.r) return ICC_CONTAIN * f;
  return ICC_INTERSECT;
}

signed main() {
  int n = in();
  while (n--) {
    Circle c1, c2;
    double x, y, r;
    cin >> x >> y >> r;
    c1 = Circle(x, y, r);

    cin >> x >> y >> r;
    c2 = Circle(x, y, r);

    cout << intersectCC(c1, c2) << endl;
  }
}

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

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        float xa, ya, ra;
        float xb, yb, rb;
        float d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); // distance of o1 and o2
        
        if (fabs(d < ra - rb) && (ra > rb))
        {
            cout<<"2"<<endl;
        }
        else if (fabs(d < ra - rb) && (ra < rb))
        {
            cout<<"-2"<<endl;
        }
        else if (fabs(d > ra - rb) && (d < ra + rb))
        {
            cout<<"1"<<endl;
        }
        else if (d > ra + rb)
        {
            cout<<"0"<<endl;
        }
//        else
//        {
//            cout<<1<<endl;
//        }
    }
}

int main()
{
    Solution();
    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 <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {

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

  int n;
  
  double d,diff;
  int i;


  scanf("%d",&n);

  for(i=0;i<n;i++) {

    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);

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

    diff=fabs(rb-ra);

    if(d>ra+rb) printf("0\n");

    else if(d<ra+rb && d>diff) printf("1\n");

    else if(ra>rb) printf("2\n");

    else if(rb>ra) printf("-2\n");

    else printf("1\n");

  }

  return 0;

}

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

double eq(double x,double y){
  double z=abs(x-y);
  return z<EPS;
}
double di(double x1,double y1,double x2,double y2){
  return sqrt(pow(x1-x2,2.0)+pow(y1-y2,2.0));
}


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

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