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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(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;
}

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

using namespace std;

int main(){
  int n;
  cin >> n;
  while(n--){
    complex<double> c1,c2;
    double r1,r2,dist;
    cin >> c1.real() >> c1.imag() >> r1 >> c2.real() >> c2.imag() >> r2;
    dist = abs(c1-c2);
    if(dist>r1+r2){
      cout << 0 << endl;
    }else if(dist>=abs(r1-r2)){
      cout << 1 << endl;
    }else if(r1>r2){
      cout << 2 << endl;
    }else{
      cout << -2 << endl;
    }
  }
}