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<iostream>
#include<cmath>


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

  for(int i=0;i<n;i++){
    std::cin >> xa >> ya >> ra
             >> xb >> yb >> rb;
    d = std::sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    if(ra+rb < d){
      std::cout << (int)0 << std::endl;
      break;
    }
    if(ra+d < rb){
      std::cout << (int)-2 << std::endl;
      break;
    }
    if(rb+d < ra){
      std::cout << (int)2 << std::endl;
    }else{
      std::cout << (int)1 << std::endl;
    }
  }
}

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

const long double EPS = 1e-10;

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

long double abs(long double x) {
  return (x > 0 ? x : -x);
}
/*
bool eq(long double x, long double y) {
  return abs(x - y) < EPS;
}*/

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

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

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

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

using namespace std;

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    double x1, y1, r1, x2, y2, r2;
    scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);
    double distance = sqrt(pow(x1 - x2, 2.0) + pow(y1 - y2, 2.0));
    if (distance > r1 + r2) {
      puts("0");
    } else if (distance + r2 < r1) {
      puts("2");
    } else if (distance + r1 < r2) {
      puts("-2");
    } else {
      puts("1");
    }
  }

  return 0;
}

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

int main() {
	int n;
	vector<int> r;
	cin >> n;
	for (int i; i<n; i++)
	{
		double xa,ya,ra,xb,yb,rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (pow(xa-xb,2)+pow(ya-yb,2) > pow(ra+rb,2))
		{
			r.push_back(0);
		} else if (pow(xa-xb,2)+pow(ya-yb,2) < pow(ra-rb,2)) {
			(ra > rb) ? r.push_back(2) : r.push_back(-2);
		} else {
			r.push_back(1);
		}
	}
	for (int i=0; i<r.size(); i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

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

using namespace std;

typedef complex<double> Point;

//ツ円Aツつェツ円Bツづーツ環ョツ全ツづ可甘慊づ楪つゥツ板サツ津ィツつキツづゥ
bool includesCircle(const Point &ca, double ra, const Point &cb, double rb) {
    return norm(ca-cb) < pow(ra-rb, 2) && rb < ra;
}

//ツ円Aツづ円Bツつェツ古ーツづュツづづつ「ツづゥツつゥツ板サツ津ィツつキツづゥ
bool intersectsCircle(const Point &ca, double ra, const Point &cb, double rb) {
    return norm(ca-cb) <= pow(ra+rb, 2);
}

int main() {
    int N;
    cin >> N;
    while(N--) {
        Point ca, cb;
        double ra, rb;
        cin >> ca.real() >> ca.imag() >> ra >> cb.real() >> cb.imag() >> rb;
        if(includesCircle(ca, ra, cb, rb)) cout << 2 << endl;
        else if(includesCircle(cb, rb, ca, ra)) cout << -2 << endl;
        else if(intersectsCircle(ca, ra, cb, rb)) cout << 1 << endl;
        else cout << 0 << 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++: // AOJ 0023
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const long double EPS = 1e-8;

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

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

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

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

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

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

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

int main(){
	int n;
	float xa,ya,ra,xb,yb,rb;
	float L;
	int i;
	
	scanf("%d",&n);
	
	for(i = 0;i < n;i++){
		scanf("%f %f %f %f %f %f",&xa,&ya,&ra,&xb,&yb,&rb);
		L = sqrt(pow(xa-xb,2) + pow(ya-yb,2));
		if(L > ra+rb){
			printf("0\n");
		}else if(L >= fabs(ra-rb)&&L <=ra+rb){
			printf("1\n");
		}else if(L < fabs(ra-rb)){
			if(ra > rb){
				printf("2\n");
			}else{
				printf("-2\n");
			}
		}
	}
	
	return 0;
}

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>
#include<cmath>
using namespace std;

int main() {
	double a, b, c, d, e, f;
	int n;
	cin >> n;
	for(int i=0;i<n;i++)
	 {
		cin >> a >> b >> c >> d >> e >> f;

		double g = sqrt(((a + d)*(a + d) + (b + e)*(b + e)));
		if (g > c + f) { cout << "0" << endl; }
		else if (g < f - c) { cout << "-2" << endl; }
		else if (g < c - f){ cout << "2" << endl; }
		else { cout << "1" << endl; }
	}
	return 0;
}