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<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("-2");goto L;}
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar)){puts("2");goto L;}
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<(ar+br)&&max(ar,br)-min(ar,br)<abs(a.first-b.first)){puts("1");goto L;}
        puts("0");
    L:;
        
    }
}

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

inline double distance(double xa, double ya, double xb, double yb){
	return std::sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
}

int judge(std::vector<double> ve){
	double center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(ve[2] >= center_dis + ve[5]){
		return 2;
	}else if(ve[5] >= center_dis + ve[2]){
		return -2;
	}else{
		return 1;
	}
}

int main(void){
	int num;
	std::vector<double> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

C++: #include <iostream> 
#include <cmath> 
#include <string> 
#include <vector>
   
 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_x = abs(ax-bx);
        double dis_y = abs(ay-by); 
double dist = sqrt(dis_x * dis_x + dis_y * dis_y);
        if ( dist > ar + br )
             cout << 0;  } 
else if ( dist + ar < br ) { 
             cout << -2;  }
 else if ( dist + br < ar ) { 
             cout << 2;  } 
else 
             cout << 1<< endl; 
     }
    return 0; 
 }

C++: #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair
typedef long long LL;
#define EPS (1e-6)
double zero(double d){
  return d < EPS ? 0.0 : d;
}

typedef pair<int,int> P;


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(7);
  int INF = 1000000;

  int N;
  while(cin>>N){
    double x1,y1,r1,x2,y2,r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

    double dis = sqrt( pow((x1-x2),2) + pow((y1-y2),2) );
    if( dis >= r1+r2 )
      cout << 0 << endl;
    else if( dis >= max(r1,r2) )
      cout << 1 << endl;
    else if( r1 >= r2+dis )
      cout << 2 << endl;
    else 
      cout << -2 << endl;
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    int n;
    cin >> n;
    rep(i, 0, n){
        int ans;
        double x[2], y[2], r[2];
        rep(j, 0, 2) cin >> x[j] >> y[j] >> r[j];
        double d = sqrt(pow(x[0] - x[1], 2) + pow(y[0] - y[1], 2));
        if(r[0] + r[1] < d) ans = 0;
        else if(r[0] > d + r[1]) ans = 2;
        else if(r[1] > d + r[0]) ans = -2;
        else if(fabs(r[0] + r[1] - d) < 1e-8) ans = 1;        
        cout << ans << 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*ra > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + rb*rb ) ans = 2;
    else if( rb*rb > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + ra*ra ) ans = -2;
    else if( (ra*ra)+(rb*rb) >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) ans = 1;


    cout << ans << endl;
  }

  return 0;
}

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

int main(void){
	int n = 0;
	double xa, ya, ra, xb, yb, rb;
	double d = 0.0;
	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%lf %lf %lf %lf %lf %lf",
			&xa, &ya, &ra, &xb, &yb, &rb);
		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));

		if(d > ra+rb){
			puts("0");
		}else if(ra > d+rb){
			puts("2");
		}else if(rb > d+ra){
			puts("-2");
		}else{
			puts("1");
		}
	}
	return 0;
}

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

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

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

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