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 <stack>
#include <stdio.h>
#include <cmath>
#include <utility>
using namespace std;
int main()
{
    int n;
	cin>>n;
	while(n--){
		int ans=0;
		double ax,ay,ar,bx,by,br,d;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		d=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(d<abs(ar-br)){//a)b||a(b
			ans=2;
			if(ar<br)ans*=-1;
		}else if(d<=ar+br){
			ans=1;
		}
		cout<<ans<<endl;
	}
    return 0;
}

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

using namespace std;

int main(void){

  double xa,ya,ra;
  double xb,yb,rb;

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

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

int main() {
	int n;
	double xa, ya, xb, yb, ra, rb;
	vector<int> Decision;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if ((ra+rb)*(ra + rb) < ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)))Decision.push_back(0);
		else if ((ra - rb)*(ra - rb) < ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) && ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) <= (ra + rb)*(ra + rb))Decision.push_back(1);
		else if ((ra - rb)*(ra - rb) >= ((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb))) {
			if (ra > rb)Decision.push_back(2);
			else Decision.push_back(-2);
		}
	}
	for (int i = 0; i < Decision.size(); i++)cout << Decision[i] << endl;
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

int main(){
	long long 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 ab = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
		if (ab - (ra - rb) * (ra - rb) <= EPS) {
			if (ra >= rb) cout << 2 << endl;
			else cout << -2 << endl;
		} else if (ab - (ra + rb) * (ra + rb) <= EPS) {
			cout << 1 << endl;
		} else {
			cout << 0 << endl;
		}
	}
	return 0;
}

C++: /*
中心が (xa, ya) で半径 ra の円 A と、中心が (xb, yb) で半径 rb の円 B が与えられたとき、
 B が A の中にあるとき 2、
 A が B の中にあるとき -2、
 A の円周と B の円周が交わっている場合 1、
 A と B が重なっていないとき 0
を出力して終了するプログラムを作成して下さい。なお A と B は同じものではないとします。
xa ya ra xb yb rb
*/
#include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  int n;
  cin >> n;
  while (n--) {
    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));
    int res;
    if (rb + d < ra) {
      res = 2;
    } else if (ra + d < rb) {
      res = -2;
    } else if (d < ra + rb) {
      res = 1;
    } else {
      res = 0;
    }
    cout << res << endl;
  }
}

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

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

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

inline double func(const double x){
	return x * x;
}

int state_circles(const std::vector<double> &a, const std::vector<double> &b){
	double d;
	d = func(a[0] - b[0]) + func(a[1] - b[1]);
	if(func(a[2] + b[2]) < d)
		return 0;
		if(func(a[2] - b[2]) > d){
		if(a[2] > b[2])
			return 2;
		else 
			return -2;
	}
	
	else 
		return 1;
}

int main(){
	std::vector<double> a(3), b(3);
	int data_num;
	std::cin >> data_num;
	for(int i = 0; i < data_num; ++i){ 
		std::cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];
		std::cout << state_circles(a, b) << std::endl;
	}
	
	return 0;
}

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

std::pair<double, double> p, q;
double r_p, r_q;
int n;

void solve() {
    double center_dist = pow(p.first - q.first, 2) + pow(p.second - q.second, 2);
    double radius_dist = pow(r_p+r_q, 2);

    if (center_dist > radius_dist) {
        std::cout << 0 << std::endl;
    } else if (center_dist < pow(r_q, 2) + pow(r_p, 2) - 2*r_p*r_q) {
        if (r_p > r_q) {
            std::cout << 2 << std::endl;
        } else {
            std::cout << -2 << std::endl;
        }
    } else {
        std::cout << 1 << std::endl;
    }
}

int main(void) {
    std::cin >> n;
    for (int i=0; i<n; i++) {
        std::cin >> p.first >> p.second >> r_p
                 >> q.first >> q.second >> r_q;
        solve();
    }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main (){

  int n,d[1000];
  
  double a[6],b,c;
  
  cin >>n;

  for(int j=0 ; j < n ; j++){
    
    for(int i=0 ; i < 6 ; i++){
      cin >> a[i];
    }
    
    c=(a[0]-a[3])*(a[0]-a[3])+(a[1]-a[4])*(a[1]-a[4]);
    b=sqrt(c);
    
    
    if( a[2]-b > a[5]){
      d[j]=2;
    }else if( a[5]-b > a[2] ){
      d[j]=-2;
    }else if( b > a[2]+a[5]){
      d[j]=0;
    }else{
      d[j]=1;
    }
    
  }

  for( int i=0 ; i < n ; i++){
    cout<<d[i]<<endl;
  }
  
  return 0;
  
}

C++: #include<bits/stdc++.h>
using namespace std;
  
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
  
typedef long long ll;
typedef pair<int, int> ii;
 
#define EPS 1e-8
 
int main(){
     
        int n;
        cin >> n;
        while(n--){
                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(d > ra + rb) cout << 0 << endl;
                else if(d < fabs(ra - rb)){
                        if(ra > rb) cout << 2 << endl;
                        else 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=1; i<=n; i++){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));

        if(ra + rb < d){
            cout << "0";
        }else if(ra + d < rb){
            cout << "-2";
        }else if(rb + d < ra){
            cout << "2";
        }else{
            cout << "1";
        }
    }

    return 0;
}