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)
		// println(xa, ya, ra, xb, yb, rb)
		dis := math.Sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
		if dis + ra < rb {
			fmt.Println(-2)
		} else if dis + rb < ra {
			fmt.Println(2)
		} else if dis > rb + ra {
			fmt.Println(0)
		} else {
			fmt.Println(1)
		}
	}
}

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

int check_intersection(const double ra, const double rb, const double distance){
	if(distance >= (ra + rb)){
		return 0;
	}else if(ra > rb){
		return ((distance + rb) < ra) ? 2 : 1;
	}else{
		return ((distance + ra) < rb) ? -2 : 1;
	}
}

int main(){
	int data_set;
	std::cin >> data_set;
	std::vector<double> xa(data_set), ya(data_set), ra(data_set), xb(data_set), yb(data_set), rb(data_set);
	for(int i = 0; i < data_set; ++i){
		std::cin >> xa[i] >> ya[i] >> ra[i] >> xb[i] >> yb[i] >> rb[i];
	}
	double distance;
	for(int i = 0; i < data_set; ++i){
		distance = sqrt(pow(xa.at(i) - xb.at(i), 2) + pow(yb.at(i) - yb.at(i), 2));
		std::cout << check_intersection(ra.at(i), rb.at(i), distance) << std::endl;
	}
	return 0;
}

C++: //接する場合が未定義なのだが…
#include<iostream>
using namespace std;

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

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

int main(void)
{
  int N;
  scanf("%d", &N);

  int i;
  for (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 distance = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
    int result;
    if (distance > ra + rb) {
      result = 0;
    }
    else if (distance < ra || distance < rb) {
      if (ra > rb) {
        result = 2;
      }
      else {
        result = -2;
      }
    }
    else {
      result = 1;
    }

    printf("%d\n", result);
  }

  return 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 = 1;
    if( d > ra + rb) ret = 0;
    if( d + rb < ra) ret = 2;
    else if( d + ra < rb) ret = -2;

    cout << ret << endl;
  }
}

C++: #include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>

using namespace std;

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

	cin >> n;
	while(n--){
		int ret = 1;
		double d;

		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		d = sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
		if(ra + rb < d){
			ret = 0;
		}else if(ra - rb > d){
			ret = 2;
		}else if(rb - ra > d){
			ret = -2;
		}

		cout << ret << endl;
	}

	return 0;
}

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

inline double distance(std::array<double, 2> pa,std::array<double, 2> pb){
	return sqrt( (pa[0] - pb[0])*(pa[0] - pb[0]) + (pa[1] - pb[1])*(pa[1] - pb[1]) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;
	std::vector<int> number;
	for(int i = 0; i < dataSetNum; ++i){
		std::array<double, 2> pa[i];
		std::array<double, 2> pb[i];
		double ra[i],rb[i];

		std::cin >> pa[i][0] >> pa[i][1] >> ra[i] >> pb[i][0] >> pb[i][1] >> rb[i];
		//if A and B do not overlap
		if(distance(pa[i],pb[i]) > ra[i] + rb[i]) number[i] = 0;
		//if B is in A
		else if(ra[i] > rb[i] && distance(pa[i],pb[i]) + rb[i] <= ra[i]) number[i] = 2;
		//if A is in B,
		else if(rb[i] > ra[i] && distance(pa[i],pb[i]) + ra[i] <= rb[i]) number[i] = -2;
		//if circumference of A and B intersect
		else number[i] = 1;
	}
	for(int i = 0; i < dataSetNum; ++i) std::cout << number[i] << std::endl;
	return 0;
	}

C++: #include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;

#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;

int main() {
  int n;
  cin >> n;
  double x[2], y[2], r[2];
  const double EPS = 1e-9;
  for (int z = 0; z < n; z++) {
    cin >> x[0] >> y[0] >> r[0];
    cin >> x[1] >> y[1] >> r[1];
    double cdif = sqrt((x[0]-x[1])*(x[0]-x[1]) - (y[0]-y[1])*(y[0]-y[1]));
    if (cdif+r[0]-r[1] < -EPS) cout << -2 << endl;
    else if (cdif+r[1]-r[0] < -EPS) cout << 2 << endl;
    else if (cdif-r[0]-r[1] < EPS) cout << 1 << endl;
    else cout << 0 << endl;
  }
}

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;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));

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

    return 0;
}