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>

#define reps(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) reps(v, 0, n)
#define lep(v, n) reps(v, 1, n + 1)
#define rreps(v, f, l) for (int v = (l), v##_ = (f); v >= v##_; --v)
#define rrep(v, n) rreps(v, 0, n - 1)
#define rlep(v, n) rreps(v, 1, n)
#define show_a(a, size) rep(a##_it, size) std::cout << a[a##_it] << " \n"[a##_it == a##_it_ - 1];
#define show_v(v) show_a(v, v.size())
#define debug(x) std::cerr << #x << " = " << (x) << "\n";

using namespace std;

typedef long long int lint;
typedef complex<double> P;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

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

C++: #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;

int main(void){
	double x1,x2,y1,y2,r1,r2;
	int n;
	cin >> n;
	rep(i,0,n){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2 ;
		x1 = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
		
		if(r1 >= x1 + r2){
			cout << 2;
		}
		else if(r2 >= x1 + r1){
			cout << -2;
		}
		else if(r1 + r2 <= x1){
			cout << 0;
		}
		else{
			cout << 1;
		}
		cout << "\n";
	}
	return 0;
}

C++: #include<cstdio>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
int ci(double xa,double ya,double ra,double xb,double yb,double rb){
  double diff2 = (xb-xa)*(xb-xa)+(yb-ya)*(yb-ya);
  if(diff2 > (ra+rb)*(ra+rb)){return 0;}
  if(diff2 > ra*ra && diff2 > rb*rb){return 1;}
  if(ra>=rb){
    if((ra-rb)*(ra-rb)>diff2){return 2;}
    else{return 1;}
  }else{
    if((rb-ra)*(rb-ra)>diff2){return -2;}
    else{return 1;}
  }
}
int main(){
  int n;scanf("%d",&n);
  REP(i,n){
    double xa,ya,ra,xb,yb,rb;
    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
    printf("%d\n",ci(xa,ya,ra,xb,yb,rb));
  }
}

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

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-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 = 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<bits/stdc++.h>
using namespace std;

int intersect_circle(double xa, double ya, double ra, double xb, double yb, double rb){
    double dsq = (xb - xa) * (xb - xa) + (yb - ya) * (yb - ya);
    double rs = (ra + rb) * (ra + rb);
    double rd = (ra - rb) * (ra - rb);
    if(dsq > rs)return 0;
    else if(dsq <= rs && dsq >= rd)return 1;
    else if(ra > rb)return 2;
    else return -2;
}

int main(){
    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;
        cout << intersect_circle(xa, ya, ra, xb, yb, rb) << endl;
    }

    return 0;
}

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

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

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

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

int main(){
	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 dist=(ya-yb)*(ya-yb)+(xa-xb)*(xa-xb);
		// AÆBªdÈçÈ¢
		if(!EQ((ra+rb)*(ra+rb),dist)&&(ra+rb)*(ra+rb)<dist)
			cout<<0<<endl;
		// ~üªðíé
		else if(((abs(ra-rb))*(abs(ra-rb))<dist))
			cout<<1<<endl;
		else if(abs(ra-rb)*abs(ra-rb)>dist){
			// Ç¿ç©ªÉ¶Ý·é
			if(ra>rb)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
		}
		else
			cout<<1<<endl;
	}

	return 0;
}

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

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

	return 0;
}