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++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

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

int hit(Circle c0, Circle c1)
{
	double x = (c1.x - c0.x);
	double y = (c1.y - c0.y);

	double d = sqrt(x * x + y * y);
	if (d <= c0.r + c1.r)
	{
		if (c0.r >= d || c1.y >= d)
		{
			return 2;
		}
		else
		{
			return 1;
		}
	}
	else
	{
		return 0;
	}
}

int main()
{
	int n;
	for (cin >> n; n--;)
	{
		Circle c0, c1;
		cin >> c0.x >> c0.y >> c0.r;
		cin >> c1.x >> c1.y >> c1.r;

		cout << hit(c0, c1) << endl;
	}
}

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

using namespace std;

int main(void){

	double xa,ya,ra,xb,yb,rb;
	double xs,ys,rw;
	int n;

	cin>>n;

	for(int i=0;i<n;i++){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		xs=xa-xb;
		ys=ya-yb;
		rw=ra+rb;
		if(xs*xs+ys*ys>rw*rw) cout<<"0"<<endl;
		else if(sqrt(xs*xs+ys*ys)+rb<ra) cout<<"2"<<endl;
		else if(sqrt(xs*xs+ys*ys)+ra<rb) cout<<"-2"<<endl;
		else cout<<"1"<<endl;
	}
	return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=0; i<n; i++) {
        double xa, ya, ra, xb, yb, rb;
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        double d=hypot(fabs(xb-xa), fabs(yb-ya));
        if(ra>d+rb) cout<<"2\n";
        else if(rb>d+ra) cout<<"-2\n";
        else if(ra+rb<d) cout<<"0\n";
        else cout<<"1\n";
    }
    return 0;
}

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

int main()
{
	int n;
	double xa, ya, ra, xb, yb, rb;
	double eps = 1e-8;
	
	cin >> n;
	while(n--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		//B in A
		if( hypot(xa - xb, ya - yb) + rb + eps < ra )
			cout << 2 << endl;
		//A in B
		else if( hypot(xa - xb, ya - yb) + ra + eps < rb )
			cout << -2 << endl;
		//A intersect B
		else if( hypot(xa - xb, ya - yb) + eps < ra + rb )
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		double d = abs(ax-bx)*abs(ax-bx) + abs(ay-by)*abs(ay-by);
		d = sqrt(d);
		//printf("%f\n", d);
		if (d > ra+rb) puts("0");
		else if (d < rb && d < ra && ra > rb) puts("2");
		else if (d < ra && d < rb && rb > ra) puts("-2");
		else puts("1");
	}
	return 0;
}

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

int solve(double xa, double ya, double ra, double xb, double yb, double rb){
    double distance = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
    if (distance > ra + rb) return 0;
    else if (distance < ra - rb) return 2;
    else if (distance < rb - ra) return -2;
    else return 1;
}

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;
	cout << solve(xa, ya, ra, xb, yb, rb);
    }
}

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

int hantei(double x1, double y1, double x2, double y2, double r1, double r2)
{
  double d = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
  double sr = (r1+r2)*(r1+r2);
  double dr = (r1-r2)*(r1-r2);
  d = sqrt(d);
  sr = sqrt(sr);
  dr = sqrt(dr);
  if(d > sr){
    return 0;
  }else if(d < sr && dr < d){
    return  1;
  }else if(dr > d){
    return (r1>r2)? 2 : -2;
  }else{ 
    return 1;
  }
}

int main(void)
{
  int n, ans;
  double xa, ya, ra, xb, yb, rb;
  
  cin >> n;
  for(int i = 0 ; i < n ; i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    ans = hantei(xa, ya, xb, yb, ra, rb);
    cout << ans << endl;
  }
  return 0;
}

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

constexpr double EPS = 1e-9;

struct circle {
	double x, y, r;
	circle(double x_ = 0.0, double y_ = 0.0, double r_ = 0.0):x(x_), y(y_), r(r_) {}
};

istream &operator>>(istream &is, circle &c) {
	return is >> c.x >> c.y >> c.r;
}

// Is b in a
bool in(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return b.r + EPS < a.r && d + EPS < a.r - b.r;
}

bool intersect(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return d < a.r + b.r + EPS && d + EPS > abs(a.r - b.r);
}

int solve() {
	circle a, b;
	cin >> a >> b;

	if(in(a, b)) return 2;
	if(in(b, a)) return -2;
	if(intersect(a, b)) return 1;
	return 0;
}

int main() {
	int t;
	cin >> t;

	while(t--) cout << solve() << endl;

	return EXIT_SUCCESS;
}

C++: #include<iostream>
#include<complex>
#include<cmath>
#include<map>
#define fs first
#define sc second
#define EPS (1e-6)
using namespace std;


typedef complex<double> P;
typedef pair<P,int> 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(abs(a.sc+b.sc - d) < EPS)return -3; //one cross point (outside)
  if(b.sc+d + EPS < a.sc)return 1;       //no intersection (inside,B in A)
  if(abs(b.sc+d - a.sc) < EPS)return 3;  //one cross point (inside,B in A)
  if(a.sc+d + EPS < b.sc)return 2;       //no intersection (inside,A in B)
  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 <<  2 << endl;
    else if(v==2)cout << -2 << endl;
    else if(v==-1)cout << 0 << endl;
    else cout << 1 << endl;

  }
}

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

using namespace std;

int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
	double xa,ya,ra,xb,yb,rb,l;
	cin >> xa >> ya >> ra >> xb >> yb >> rb;
	l = sqrt(pow((xa-xb),2)+pow((ya-yb),2));
	if(ra > l + rb) 
	  cout << '2' << endl;	
	else if(rb >= l + ra) 
	  cout << "-2" << endl;	
	else if(l <= ra + rb) 
	  cout << '1' << endl;	
	else 
	  cout << '0' << endl;  

  }
  return 0;
}

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
	int N;
	cin>>N;
	while(N--){
		int ans;
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double x;
		x=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(x>(ar+br))ans=0;
		else if(abs(ar-br)<=x&&x<=(ar+br))ans=1;
		else if(x<abs(ar-br)&&ar>br)ans=2;
		else ans=-2;
		cout<<ans<<endl;
	}
    return 0;
}