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++: // AOJ 0023
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const double EPS = 1e-7;

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 (d < sq(ra)) {
      cout << 2 << endl;
    } else if (d < sq(rb)) {
      cout << -2 << endl;
    } else if (eq(d, sq(abs(ra - rb)))) {
      cout << 1 << 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, 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>
using namespace std;

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

int judge_intersection(circle ca, circle cb){
	double dis2 = (ca.x - cb.x) * (ca.x - cb.x)
				+ (ca.y - cb.y) * (ca.y - cb.y);
	if((ca.r > cb.r) && ((ca.r - cb.r) * (ca.r - cb.r) > dis2)){
		return 2;
	} else if((cb.r > ca.r) && ((ca.r - cb.r) * (ca.r - cb.r) > dis2)){
		return -2;
	} else if((ca.r + cb.r) * (ca.r + cb.r) > dis2){
		return 1;
	} else {
		return 0;
	}
}

int main()
{
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		circle ca, cb;
		cin >> ca.x >> ca.y >> ca.r
			>> cb.x >> cb.y >> cb.r;
		cout << judge_intersection(ca, cb) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <complex>

using namespace std;

int main()
{
  int N;
  scanf("%d ", &N);
  
  for (int i = 0; i < N; i++) {
    double xa, ya, ra, xb, yb, rb;
    scanf("%d %d %d %d %d %d ", &xa, &ya, &ra, &xb, &yb, &rb);
    complex<double> A(xa, ya), B(xb, yb);

    double k1 = fabs(ra - rb), k2 = ra + rb;
    double d = abs(A - B);
    int num;
    if (d < k1) {
      if (ra > rb) {
	num = 2;
      } else {
	num = -2;
      }
    } else if (k1 <= d && d <= k2) {
      num = 1;
    } else if (k2 < d) {
      num = 0;
    }
    
    printf("%d\n", num);
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>

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 l = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if(l>(ra+rb)*(ra+rb)){
            cout<<0<<endl;
        }else if(l<=(ra+rb)*(ra+rb)&&l+rb*rb<=ra*ra){
            cout<<2<<endl;
        }else if(l<=(ra+rb)*(ra+rb)&&l+ra*ra<=rb*rb){
            cout<<-2<<endl;
        }else if(l<=(ra+rb)*(ra+rb)&&l<=ra*ra&&l>rb*rb){
            cout<<1<<endl;
        }
    }
    return 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-8;

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;
    }
  }
}