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<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb,d;
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    // BがAの中にあるとき
    if(ra>rb && d < ra + rb){
      cout << 2 << endl;
    } // AがBの中にあるとき
    else if(ra<rb && d < ra + rb){
      cout << -2 << endl;
    } // 円周が交わってる
    else if(d == ra + rb){
      cout << 1 << endl;
    } // 重なってないとき
    else if(d >  ra + rb){
      cout << 0 << endl;
    }
  }
}

C++: #include <iostream>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)>(ra+rb)*(ra+rb))
	{
	    ans = 0;
	}
      else
	{
	  int d = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
	  if(d  <= (ra-rb)*(ra-rb))
	    ans = 2;
	  else if (d  <= (rb-ra)*(rb-ra))
	    ans =-2;
	  else
	    ans =-1;
	}

      cout<<ans<<endl;

    }

}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n; scanf("%d", &n);
	rep(i, n) {
		double x1, y1, r1, x2, y2, r2;
		scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &r1, &x2, &y2, &r2);
		double d = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
		if (d > r1 + r2)puts("0");
		else if (r1 * 2 - d >= r2 * 2)puts("2");
		else puts("1");
	}
}

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

typedef complex<double> P;
typedef pair<P, double> C;
#define X real()
#define Y imag()
#define EPS (1e-10)

// ??? c1 ??¨??? c2 ???????????¢???
int intersectCC(C c1, C c2){
    P c1p = c1.first, c2p = c2.first;
    double c1r = c1.second, c2r = c2.second;
    long double d = abs(c1p - c2p), r1 = c1r, r2 = c2r;
    if(r1 + r2 < d)            return  0; // ??¢????????????
    if(abs(r1 + r2 - d) < EPS) return +1; // ?????\
    if(d + r1 < r2)            return -2; // c1 ??? c2 ??????
    if(d + r2 < r1)            return +2; // c2 ??? c1 ??????
    return +1; // 2?????????????????????
}

int main() {
    C a,b;
    int n; cin >> n;
    for(int i=0; i<n; i++) {
        cin >> a.first.X >> a.first.Y >> a.second;
        cin >> b.first.X >> b.first.Y >> b.second;

        cout << intersectCC(a,b) << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      double d = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
      if(d  > (ra+rb)*(ra+rb))
	ans = 0;
      else if (d < (ra-rb)*(ra-rb) && ra>rb)
	ans = 2;
      else if (d  < (rb-ra)*(rb-ra) && rb>ra)
	ans =-2;
      else
	ans =-1;
      cout<<ans<<endl;

    }

}

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

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		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 << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <cmath>
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 d=sqrt(pow(xa-xb,2)+pow(ya-yb,2));
		if ( d+rb<=ra )
			cout<<2<<endl;
		else if ( d+ra<=rb)
			cout<<-2<<endl;
		else if ( d<=ra+rb)
			cout<<1<<endl;
		else
			cout<<0<<endl;
	}
	return 0;
}

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

#define EPS 1e-9

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

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

int main(){
  int n;
  double ax,ay,ar,bx,by,br;
  double dis;

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> ar >> bx >> by >> br;

    dis = sqrt( (ax-bx)*(ax-bx) + (ay-by)*(ay-by) );
    if( dis > ar + br)cout << 0 << endl;
    else if( br < ar && dis < ar - br)cout << 2 << endl;
    else if( ar < br && dis < br - ar)cout << -2 << endl;
    else cout << 1 << endl;
  }
}

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

int main()
{
	int n;
	double xa, ya, ra, xb, yb, rb;
	
	cin >> n;
	while(n--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		//B in A
		if( hypotl(xa - xb, ya - yb) + rb < ra )
			cout << 2 << endl;
		//A in B
		else if( hypotl(xa - xb, ya - yb) + ra < rb )
			cout << -2 << endl;
		//A intersect B
		else if( hypotl(xa - xb, ya - yb) < ra + rb )
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    double xa, ya, ra, xb, yb, rb, d;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = hypot(xa - xb, ya - yb);
    if (d > ra + rb)
      cout << 0;
    else if (d + rb < ra)
      cout << 2;
    else if (d + ra < rb)
      cout << -2;
    else
      cout << 1;
    cout << "\n";
  }
}

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

const double EPS = 1.0e-6;
int main(){
	int n;
	cin>>n;
	for(int num=0; num<n; num++){
		double xa, ya, ra, xb, yb, rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double dist2 = (xb-xa)*(xb-xa)+(yb-ya)*(yb-ya);
		double dist = sqrt(dist2);
		int ans;
		if(dist+ra < rb){
			ans = -2;
		} else if(dist+rb < ra){
			ans = 2;
		} else if(ra+rb < dist){
			ans = 0;
		} else {
			ans = 1;
		}
		cout<<ans<<endl;
	}
	return 0;
}