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

using namespace std;

int main() {
    int n;
    double x1, y1, r1, x2, y2, r2;

    cin >> n;
    while ( n-- ) {
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
        /*
        2 ,原点同士の距離+r1 < r2
        -2,原点同士の距離+r2 < r1
        1 ,原点同士の距離 >= r1 + r2
        0 ,else

        a^2 = b^2 + c^2

        */
        double dx, dy, dis;
        dx = abs(x2-x1);
        dy = abs(y2-y1);
        dis = sqrt(pow(dx, 2) + pow(dy, 2));
        cout << dis << " " << dx << " " << dy << " " << r1 + r2 << endl;
        if ( dis + r2 < r1 ) {
            cout << 2;
        } else if ( dis + r1 < r2 ) {
            cout << -2;
        } else if ( r1 + r2 > dis ) {
            cout << 1;
        } else {
            cout << 0;
        }
        cout << endl;
    }

    return 0;
}

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

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


#define X real()
#define Y imag()
typedef complex<double> P;

int main(){
	  
	int n;
	cin>>n;
	rep(i,n){	
		double xa,ya,ra,xb,rb,yb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		
		P a = P(xa,ya);
		P b = P(xb,yb);
		
		double c = abs(a-b);
		
		if(c<=ra && c<=rb){
			if(ra>rb)puts("2");
			else puts("-2");
			continue;
		}
		if(ra+rb<c){
			puts("0");
			continue;
		}
		puts("1");
	}
	
}

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

int solve(long double d,long double ra,long double rb){
  if(ra+rb<d){
    return 0;
  }else if(ra+d<rb){
    return -2;
  }else if(rb+d<ra){
    return 2;
  }else{
    return 1;
  }
  assert(0);
  return -100;
}



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

C++: #include <iostream>
#include <math.h>
using namespace std;
struct circle{
  double x;
  double y;
  double r;
};
  int inclusion(circle,circle);
int main(){
  int n;
  circle a,b;
  cin >> n;
  for(;n;n--){
    cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
    cout<<inclusion(a,b)<<endl;
  }
  return 0;
}

int inclusion(circle a,circle b){
  double distance = sqrt( pow(b.x-a.x,2)+pow(b.y-a.y,2));
  circle d;
  int abs;
  if(a.r>b.r)abs=1;
  else
    abs=-1,d=a,a=b,b=d;
  if(distance<=a.r+b.r){
    //ツ陛ッツ甘慊つオツづつ「ツづ慊つキツ。
    if(distance<a.r){
      return 2*abs;
    }
    else{
      return 1;
    }
  }
  else{
    //ツ陛ッツ甘慊つオツづつ「ツづ慊つケツづアツ。
    return 0;
  }
}
/*
Sample Input
2
0.0 0.0 5.0 0.0 0.0 4.0
0.0 0.0 2.0 4.1 0.0 2.0
Output for the Sample Input
2
0
*/

C++: #include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r = pow(pow(xb - xa, (float)2.0) + pow(yb - ya, (float)2.0), (float)1.0/2);
		if (r > ra + rb) {
			cout << 0 << endl;
		}
		else if (r <= ra + rb) {
			if (ra >= rb) {
				if (r < ra - rb) {
					cout << 2 << endl;
				}
				else if (r >= ra - rb) {
					cout << 1 << endl;
				}
			}
			else if (ra < rb) {
				if (r <rb - ra) {
					cout << -2 << endl;
				}
				else if (r >= rb - ra) {
					cout << 1 << endl;
				}
			}
		}
	}
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <queue>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   int n;
   double x[2],y[2],r[2];
   cin>>n;
   REP(i,n){
      REP(j,2) cin >> x[j] >> y[j] >> r[j];
      if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))>r[1]+r[0])
         cout << "0" << endl;
      else if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))<r[0]&&
      sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))>r[1])
         cout << "2" << endl;
      else if(sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))<r[1]&&
      sqrt(pow(x[1]-x[0],2)+pow(y[1]-y[0],2))>r[0])
         cout << "-2" << endl;
      else cout << "1" << endl;
   }
}

C++: #include <stdio.h>
#include <math.h>
  int main(){
    int n,i;
    double xa,ya,ra,xb,yb,rb;
    scanf("%d",&n);
     for(i=0;i<n;i++){
       scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
       double dis=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);   
       dis = sqrt(dis);
       if(dis>ra+rb){
printf("%d\n",0);
continue;
}else if(dis<=ra+rb && dis>fabs(ra-rb)){
printf("%d\n",1);
continue;
}else if(ra>rb){
printf("%d\n",2);
continue;
}else{
printf("%d\n",-2);
continue;
}  
}
return 0;
}