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<stdio.h>
#include<math.h>
#include<vector>
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 k){
    return Point(x*k,y*k);
  }
  Point operator / (double k){
    return Point(x/k,y/k);
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
typedef Point Vector;
double norm(Vector a){
  return a.x*a.x+a.y*a.y;
}
double abs(Vector a){
  return sqrt(norm(a));
}
class Circle{
public:
  Point c;
  double r;
  Circle(Point c = Point(),double r = 0.0):c(c),r(r){}
};
int check(Circle a,Circle b){
  double d1 = abs(b.c-a.c) , d2 = (a.r+b.r);
  
  if(d1+b.r-a.r<EPS) return 2;
  if(d1+a.r-b.r<EPS) return -2;
  if(d1-d2>EPS) return 0;
  return 1;
}
int main(){
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    Point a,b;
    double r1,r2;
    cin >> a.x >> a.y >> r1 >> b.x >> b.y >> r2;
    Circle c1(a,r1),c2(b,r2);
    cout << check(c1,c2) << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdlib>

using namespace std;

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 dsq = pow( xb - xa, 2.0 ) + pow( yb - ya, 2.0 );
    if( sqrt( dsq ) > ra + rb ) {
      cout << 0 << endl;
      continue;
    }
//     b in a
    if( sqrt( dsq ) < ra - rb ) {
      cout << 2 << endl;
      continue;
    }

//     a in b 
    if( sqrt( dsq ) < rb - ra ) {
      cout << -2 << endl;
      continue;
    }

    cout << 1 << endl;
  }

  return EXIT_SUCCESS;
}

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

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++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>

using namespace std;

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

int main(){
	int t;
	cin>>t;
	while(t--){
		double xa,ya,ra,xb,yb,rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double len = sqrt(sq(xa-xb)+sq(ya-yb));
		if(len + rb <= ra)
			puts("2");
		else if(len + ra <= rb)
			puts("-2");
		else if(len <= ra + rb)
			puts("1");
		else 
			puts("0");
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb;
  int n;
  cin >> n;
  while(n--){
    cin >>  xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(pow(xa - xb,2) + pow(ya - yb,2));
    if(d>ra+rb)cout<<0<<endl;
    else if(ra-rb>d)cout<<2<<endl;
    else if(rb-ra>d)cout<<-2<<endl;
    else cout<<1<<endl;

  }
  return 0;
}

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

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        double xa, ya, ra;
        double xb, yb, rb;
        double d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)); // distance of o1 and o2
        
        if (d > ra + rb)
        {
            cout << "0" << endl;
        }
        else if (d >= abs(ra - rb)) // && ra + rb >= d
        {
            cout << "1" << endl;
        }
        else if (ra > rb) // d < ra - rb
        {
            cout << "2" << endl;
        }
        else
        {
            cout << "-2" << endl;
        }
    }
}

int main()
{
    Solution();
    return 0;
}

C++: #include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        float xa, ya, ra;
        float xb, yb, rb;
        float d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); // distance of o1 and o2
        
        if (fabs(d < ra - rb) && (ra > rb))
        {
            cout<<2<<endl;
        }
        else if (fabs(d < rb - ra) && (ra < rb))
        {
            cout<<-2<<endl;
        }
        else if (fabs(d > ra - rb) && (d < ra + rb))
        {
            cout<<"1"<<endl;
        }
        else if (d > ra + rb)
        {
            cout<<0<<endl;
        }
//        else
//        {
//            cout<<1<<endl;
//        }
    }
}

int main()
{
    Solution();
    return 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 << 0 << std::endl;
      break;
    }
    if(ra+d <= rb){
      std::cout << -2 << std::endl;
      break;
    }
    if(rb+d <= ra){
      std::cout << 2 << std::endl;
    }else{
      std::cout << 1 << std::endl;
    }
  }
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
using namespace std;

int main(){

  int n;
  cin >> n;
  for(int i=0; i<n; i++){
    double xa, ya, ra;
    double xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    int ans = 0;

    if( ra >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + rb ) ans = 2;
    else if( rb >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + ra ) ans = -2;
    else if( (ra)+(rb) >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) ans = 1;


    cout << ans << endl;
  }

  return 0;
}