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 <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <complex>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)

typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = (1e-10);    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) {
  return (conj(a)*b).Y;
}

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;
    P a = P(xa, ya);
    P b = P(xb, yb);

    if (GE(abs(a-b), ra+rb)) {
      std::cout << 0 << std::endl;
      continue;
    }

    if (GE(rb, abs(a-b)+ra)) {
      std::cout << -2 << std::endl;
    }else if (GE(ra, abs(a-b)+rb)) {
      std::cout << 2 << std::endl;
    }else {
      std::cout << 1 << std::endl;
    }
  }

  
  return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int loop;
    double xa, ya, ra, xb, yb, rb;
    
    cin >> loop;
    for(int i = 0; i < loop; i++){
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));

        if(d < ra - rb){
            cout << 2 << endl;
        } else if(d < rb - ra){
            cout << -2 << endl;
        } else if(d > rb + ra){
            cout << 0 << endl;
        } else {
            cout << 1 << 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 (d < r1 - r2)puts("2");
		else if (d < r2 - r1)puts("-2");
		else puts("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");
	}
}