Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var xa, ya, ra, xb, yb, rb float64
		fmt.Scan(&xa, &ya, &ra, &xb, &yb, &rb)
		// println(xa, ya, ra, xb, yb, rb)
		dis := math.Sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
		if dis + ra < rb {
			fmt.Println(-2)
		} else if dis + rb < ra {
			fmt.Println(2)
		} else if dis > rb + ra {
			fmt.Println(0)
		} else {
			fmt.Println(1)
		}
	}
}

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

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

C++: #include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#define PI 3.1415926535897932384626433
using namespace std;
int main(){
    int N;
    cin>>N;
    for(int i=0;i<N;i++){
        double ax,ay,ar,bx,by,br;
        cin>>ax>>ay>>ar>>bx>>by>>br;
        double dis=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
        if(dis+ar<br)cout<<"-2"<<endl;
        else if(dis+br<ar)cout<<"2"<<endl;
        else if(ar+br<dis)cout<<"0"<<endl;
        else cout<<"1"<<endl;
    }
    return 0;
}

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

int main(void){
  int n;
  cin >> n;
  for( int i = 0; i < n; i++){
    bool f = true;
    double xa, xb, ya, yb, ra, rb;
    long double r;

    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    r = sqrt( pow(fabs(xa - xb), 2) + pow(fabs(ya - yb), 2));
    // cout << sqrt( pow(fabs(xa - xb), 2) + pow(fabs(ya - yb), 2)) << endl;
    //cout << r << endl;
    if( r > ra + rb ){
      cout << 0 << endl;
    }
    else{
    
      if(ra < rb)
	f = false;

      if(f){

	if(r + rb < ra){
	  cout << 2 << endl;
	}else{
	  cout << 1 << endl;
	}
      }

      else{
	if(r + ra < rb){
	  cout << -2 << endl;
	}else{
	  cout << 1 << endl;
	}
      }
    }
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		pair<double, double>p1, p2;
		double r1, r2;
		cin >> p1.first >> p1.second >> r1;
		cin >> p2.first >> p2.second >> r2;
		double dis = sqrt(pow(p1.first - p2.first, 2) + pow(p1.second + p2.second, 2));
		if (dis > r1 + r2)cout << 0 << endl;
		else if (dis < r1 - r2)cout << 2 << endl;
		else if (dis < r2 - r1)cout << -2 << endl;
		else cout << 1 << endl;
	}
}

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

using namespace std;

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

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

int main(void) {

  double xa,ya,ra;
  double xb,yb,rb;

  int n;
  
  double d,dr,sr;
  int i;


  scanf("%d",&n);

  for(i=0;i<n;i++) {

    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);

    d=(xb-xa)*(xb-xa)+(yb-ya)*(yb-ya);

    dr=(rb-ra)*(rb-ra);

    sr=(ra+rb)*(ra+rb);

    if(d>sr) printf("0\n");

    else if(d<sr && d>dr) printf("1\n");

    else if(dr>d && ra>rb) printf("2\n");

    else if(dr>d && rb>ra) printf("-2\n");

    //else printf("1\n");

  }

  return 0;

}

C++: #include <iostream>
//#include <algorithm>
//#include "math.h"

using namespace std;

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

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
using namespace std;

int main() {
	int a; cin >> a;
	for (int b = 0; b < a; b++) {
		double x1, y1, r1, x2, y2, r2;
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		double s = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		if (s+r1<r2) {
			puts("-2");
		}
		else if (s+r2<r1) {
			puts("2");
		}
		else if (s - r2 - r1 > 0) {
			puts("0");
		}
		else puts("1");
	}
}

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

inline double calcDistance(double x, double y){
	return hypot(x, y);
}

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 = calcDistance(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;
	}
}

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

int main(int argc, char *argv[]) {
	int dataN;
	scanf("%d", &dataN);
	for (int i = 0; i < dataN; i++) {
		float ax, ay, ra, bx, by, rb;
		scanf("%f %f %f %f %f %f", &ax, &ay, &ra, &bx, &by, &rb);
		double d = (ax-bx)*(ax-bx) + (ay-by)*(ay-by);

		d = sqrt(d);

		if (d + rb < ra) {
		  cout<<2<<endl;
		} else if (d + ra < rb) {
		  cout<<-2<<endl;
		} else if (d <= ra + rb || d == abs(ra-rb)) {
		  cout<<1<<endl;
		} else {
		  cout<<0<<endl;
		}
	}
	return 0;
}

C++: //Circles Intersection
//2Ì~ÌSÆ¼aª^¦çê½Æ«A»Ì2ÂÌ~ªÚµÄ¢é©Aàï³êÄ¢é©AðíçÈ¢©ð»è¹æ


#include<iostream>
#include<cmath>
using namespace std;

double Square(double x){return x*x;}
double Distance(double x, double y)
{
	return sqrt(Square(x) + Square(y) );
}

int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		double ax, bx, ay, by, ar, br;
		cin >> ax >> ay >> ar >> bx >> by >> br;

		//Ql@http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1251422802

		//à~ÌSðciA¼aðriAO~ÌSðcoA¼aðroÆ·éÆ
		//|ci-co|<=ro-ri@ÈçA®SÉàï·éEEEçµ¢
		double distance = Distance(ax-bx, ay-by);
		if(distance <= br - ar)	//BªAðàï
			cout << -2 << endl;
		else if(distance <= ar - br)	//AªBðàï
			cout << 2 << endl;
		//|ci-co| <= ar+br ËaÆbÍdÈé
		else if(distance <= ar+br)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <complex>
#include <algorithm>
#define EPS 1e-10
#define EQ(a,b) ((a - b) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))
using namespace std;

typedef complex<double> P;

int main ()
{
    int n;
    cin >> n;


    while (n--) {
        double ax, ay, ar, bx, by, br;
        cin >> ax >> ay >> ar >> bx >> by >> br;
        P a = P(ax, ay);
        P b = P(bx, by);

        double d = abs(a - b);
        if (d > ar + br) {
            cout << "0" << endl;
        } else if (d + ar <  br) {
            cout << "-2" << endl;
        } else if (d + br < ar) {
            cout << "2" << endl;
        } else {
            cout  << "1" << endl;
        }
    }

    return 0;
}