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<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<iomanip>
using namespace std;
 
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
 
class Point{
    public:
        double x, y;
 
        Point(double x = 0, double y = 0): x(x), y(y) {}
 
        Point operator + (Point p){ return Point(x + p.x, y + p.y);}
        Point operator - (Point p){ return Point(x - p.x, y - p.y);}
        Point operator * (double a){ return Point(a * x, a * y);}
        Point operator / (double a){ return Point(x / a, y / a);}
 
        double abs(){ return sqrt(norm());}
        double norm(){ return x * x + y * y;}
 
        bool operator < (const Point &p) const{
            return x != p.x ? x < p.x : y < p.y;
        }
 
        bool operator == (const Point &p) const{
            return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
        }
};
 
class Circle{
    public:
        Point c;
        double r;
        Circle(Point c = Point(), double r = 0.0): c(c), r(r) {}
};
 
double getDistance(Point a, Point b){
    return (a - b).abs();
}
 
int main(){
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++){
        Circle a, b;
        cin >> a.c.x >> a.c.y >> a.r >> b.c.x >> b.c.y >> b.r;
        if(a.r > (b.r + getDistance(a.c, b.c))) cout << 2 << endl;
        else if(b.r > (a.r + getDistance(a.c, b.c))) cout << -2 << endl;
        else if(a.r + b.r < getDistance(a.c, b.c)) cout << 0 << endl;
        else cout << 1 << endl;
    }
    return 0;
}

C++: /**************************************************************************************************************
   *  Md. Abdulla Al Mamun (Nayon)
   *  ID: 1306001
   *  Session: 2013-2014
   *  Department of Computer Science and Engineering
   *  Begum Rokeya University, Rangpur (BRUR)
***************************************************************************************************************/
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <ios>
#include <set>
#include <map>

using namespace std;

#define PI acos(-1.0)
#define EPS 1e-9
#define INF 1 << 28
#define sq(a) ((a) * (a))
#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define ppb() pop_back()
#define mp(a, b) make_pair(a, b)
#define endl '\n'
#define MAX 100000
#define MOD 1000000007
#define dprint(expr) printf(#expr " = %lf\n", expr)

inline bool isEq(double a, double b){return (abs(a-b) < EPS);}
inline double NegZero(double x){if(isEq(x, -0.0))return +0.0;else return x;}

typedef long long ll;
typedef pair<int, int> pii;

//#define isValid(a, b) ((a >= 0 && a < b) ? 1 : 0)
//int dr[]  =  {0, -1, -1, -1,  0,  1, 1, 1};
//int dc[]  =  {1,  1,  0, -1, -1, -1, 0, 1};

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //ios_base::sync_with_stdio(false); cin.tie(NULL);
    double xa, ya, ra, xb, yb, rb;
    int t;
    cin >> t;
    while(t--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		int d = sqrt(sq(xa-xb) + sq(ya-yb));
		if(max(ra,rb) >= d+min(ra,rb)){
			if(ra >= rb)
				cout << "2" << endl;
			else if(rb > ra)
				cout << "-2" << endl;
			/*else
				cout << "1" << endl;*/
		}
		else if(d <= ra+rb)
			cout << "1\n";
		else
			cout << "0" << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int resolve(double x1, double y1, double r1, double x2, double y2, double r2){
	double d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
	if(d<abs(r1-r2)){
	    if(r1>r2)   return 2;
	    else    return -2;
	}
	else if(d>=abs(r1-r2) && d<=(r1+r2))    return 1;
	else    return 0;
}
int main(){
	int N;
	cin>>N;
	while(N--){
		double x1,y1,r1, x2, y2, r2;
		cin>>x1>>y1>>r1>>x2>>y2>>r2;
		cout<<resolve(x1, y1, r1, x2, y2, r2);
		cout<<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++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <complex>
#include <vector>
using namespace std;
typedef complex<double> P;

int main() {
  int Tc;
  cin >> Tc;
  while(Tc--) {
    P p1, p2;
    double r1, r2;
    cin >> p1.real() >> p1.imag() >> r1;
    cin >> p2.real() >> p2.imag() >> r2;
    double d = abs(p1-p2);
    int res;
    if(d <= r1-r2) res = 2;
    else if(d <= r2-r1) res = -2;
    else if(d > r1+r2) res = 0;
    else res = 1;
    cout << res << endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int c;
	double ax,ay,ar,bx,by,br;
	cin>>c;
	for(int i=0;i<c;i++){
		cin>>ax>>ay>>ar>>bx>>by>>br;
		if((ax+ar>bx+br&&ax-ar<bx-br) && (ay+ar>by+br&&ay-ar<by-br))
			cout<<"2";
		else if((bx+br>ax+ar&&bx-br<ax-ar) && (by+br>ay+ar&&by-br<ay-ar))
			cout<<"-2";
		else if((ax-bx)*(ax-bx)+(ay-by)*(ay-by)<(ar+br)*(ar+br))
			cout<<"1";
		else cout<<"0";
	cout <<endl;	
	}				
}

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

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

C++: #include <iostream>
#include <cmath>
 
int main(){
    int num;
    std::cin >> num;
     
    for(int i = 0; i < num; ++i){
        double xa, xb, ya, yb, ra, rb;
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = hypot(xa - xb, ya - yb);
         
        int answer = 1;
        if(ra + rb < d){
            answer = 0;
        }
        else if(ra - rb > d){
            answer = 2;
        }
        else if(rb - ra > d){
            answer = -2;
        }
        std::cout << answer << std::endl;
    }
    return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main() {int N;double x1,x2,y1,y2,r1,r2;while (scanf("%d",&N)!=EOF) {if (!N) return 0;while (N--) {scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&r1,&x2,&y2,&r2);double a1,a2=-2.00;if (r1>r2) a1=x1,x1=x2,x2=a1,a1=y1,y1=y2,y2=a1,a2=2.00,a1=r1,r1=r2,r2=a1;a1=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));if (a1>r1+r2) puts("0");else if (a1<r2) {if (a1+r1<r2) printf("%.0lf\n",a2); else puts("0");} else puts("1");}}}