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<math.h>
using namespace std;

int main(){
    int N;
    double xa, ya, ra, xb, yb, rb;
    cin >> N;
    for(int i=0; i<N; i++){
        cin >>xa>>ya>>ra>>xb>>yb>>rb;

        double rsum = (ra+rb)*(ra+rb), rdiff = ra-rb;
        ra-rb < 0 ? rdiff = -rdiff*rdiff : rdiff = rdiff*rdiff;
        double cntr_dst = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if(rdiff>cntr_dst){
            cout << 2;
        }else{
            if(-rdiff>cntr_dst){
                cout << -2;
            }
            if(rsum>cntr_dst && cntr_dst>fabs(rdiff)){
                cout << 1;
            }
            else{
                cout << 0;
            }
        }
        cout << 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 <iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	double xa,ya,ra,xb,yb,rb;
	for(int i=0;i<n;i++){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double l = (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya);
		if(ra>rb && l<(ra-rb)*(ra-rb)){
			cout<<"2"<<endl;
		}else if(ra<rb && l<(rb-ra)*(rb-ra)){
			cout<<"-2"<<endl;
		}else if(l<(ra+rb)*(ra+rb)){
			cout<<"1"<<endl;
		}else{
			cout<<"0"<<endl;
		}
	}
	return 0;
}