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 rep(i, n) for(int i=0; i<(n); ++i)

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

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

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

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

inline double squ_minus(double a, double b){
	double x = a - b;
	return x * x;
}

inline double squ_plus(double a, double b){
	double x = a + b;
	return x * x;
}

int main(){
	int n; // the number of datasets
	cin >> n;
	
	for(int i = 0; i < n; i++){
		std::array<double, 6> cir; // 0:xa, 1:ya, 2:ra, 3:xb, 4:yb, 5:rb
		cin >> cir[0] >> cir[1] >> cir[2] >> cir[3] >> cir[4] >> cir[5];

		double dis = squ_minus(cir[0], cir[3]) + squ_mins(cir[1], cir[4]);
		
		if(dis > squ_plus(cir[2], cir[5]){
			std::cout << "0" << std::endl;
		}else if(dis < squ_minus(cir[2], cir[5])){
			std::cout << (cir[2] > cir[5]) ? "2" : "-2" << std::endl;
		}else{
			std::cout << "1" << std::endl;
		}
	}
	return 0;
}

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

float d(float x, float y, float z, float w){
	float ret;
	ret = pow(x - z, 2) + pow(y - w, 2);
	return sqrtf(ret);
}

int main(){
	int n;
	float x[2], y[2], r[2], dd;
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dd = d(x[0], y[0], x[1], y[1]);
		if(dd>r[0]+r[1]){
			cout << 0 << endl;
		}
		else if(dd + r[0] <= r[1]){
			cout << -2 << endl;
		}
		else if (dd + r[1] <= r[0]) {
			cout << 2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

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

inline float distance(float xa, float ya, float xb, float yb){
	return std::sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
}

int judge(std::vector<float> ve){
	float center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(ve[2] > center_dis + ve[5]){
		return 2;
	}else if(ve[5] > center_dis + ve[2]){
		return -2;
	}else{
		return 1;
	}
}

int main(void){
	int num;
	std::vector<float> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

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

double r(double x1,double y1,double x2,double y2){
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
	
	}

int main() {
	// your code goes here
	int n;
	double x1,x2,y1,y2,r1,r2;
	cin>>n;
	for(int j=0;j<n;j++){
		cin>>x1>>y1>>r1>>x2>>y2>>r2;
		
		if(r(x1,y1,x2,y2)>(r1+r2)){
			cout<<0<<endl;
		}
		else if(r(x1,y1,x2,y2)>=fabs(r1-r2)&&r(x1,y1,x2,y2)=<r1+r2){
			cout<<1<<endl;
		}
		else if(r1>r2){
			cout<<2<<endl;
		}
		else if(r2>r1){
		cout<<-2<<endl;	
		
		}
		
		
	}
	
	return 0;
}

C++: #include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(void){
  int n;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    double x[2],y[2],r[2],h;
    for(int j=0;j<2;j++) scanf("%lf %lf %lf",&x[j],&y[j],&r[j]);
    h=hypot(abs(x[0]-x[1]),abs(y[0]-y[1]));
    if(h+r[1]<r[0]) puts("2");
    else if(h+r[0]<r[1]) puts("-2");
    else if(h<=r[0]+r[1]) puts("1");
    else puts("0");
  }
}

C++: // AOJ 0023
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const double EPS = 1e-9;

double sq(double x) {
  return x * x;
}

double abs(double x) {
  return (x > 0 ? x : -x);
}

bool eq(double x, double y) {
  return abs(x - y) < EPS;
}

double dist(int xa, int ya, int xb, int yb) {
  return sq(xa - xb) + sq(ya - yb);
}

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

    double d = dist(xa, ya, xb, yb);
    
    if (sq(ra) > d + EPS) {
      cout << 2 << endl;
    } else if (sq(rb) > d + EPS) {
      cout << -2 << endl;
    } else if (d < sq(ra + rb)) {
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
  }
}

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

using namespace std;

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

  cin >> n;

  while(n--){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));

    int out;

    if(ra + rb < d) out = 0;
    else if(ra + d < rb)  out = -2;
    else if(rb + d < ra)  out = 2;
    else  out = 1;

    cout << out << endl;
  }
}

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

using namespace std;

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

    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
        if(d + rb < ra)          { cout << "2"  << endl; }
        else if(d + ra < rb) { cout << "-2" << endl; }
        else if(d <= ra + rb)    { cout << "1"  << endl; }
        else                    { cout << "0"  << endl; }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


double xa, ya, ra, xb, yb, rb, d;
ll n;

int main(){
	cin >> n;
	REP(i, n){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (xa == xb&&ya == yb) d = 0;
		else if (xa == xb) d = abs(ya - yb);
		else if (ya == yb) d = abs(xa - xb);
		else d = sqrt(pow(xa - xb, 2) + (ya - yb, 2));
		if (d <= abs(ra - rb)){
			if (ra > rb){
				cout << 2 << endl;
			}
			else{
				cout << -2 << endl;
			}
			continue;
		}
		if (d <= ra + rb){
			cout << 1 << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
}