Go: package main

import (
	"fmt"
	"math"
)

func main() {
	n := scanInt()
	for i := 0; i < n; i++ {
		cal()
	}
}

func scanInt() int {
	var n int
	fmt.Scanf("%d", &n)
	return n
}

func cal() {
	var x1, y1, x2, y2, x3, y3 float64
	fmt.Scanf("%f%f%f%f%f%f", &x1, &y1, &x2, &y2, &x3, &y3)
	a := 2 * (x1 - x2)
	b := 2 * (y1 - y2)
	c := 2 * (x1 - x3)
	d := 2 * (y1 - y3)
	e := x1*x1 - x2*x2 + y1*y1 - y2*y2
	f := x1*x1 - x3*x3 + y1*y1 - y3*y3

	px := (d*e - b*f) / (a*d - b*c)
	py := (a*f - c*e) / (a*d - b*c)

	r := math.Sqrt((x1-px)*(x1-px) + (y1-py)*(y1-py))
	fmt.Printf("%.3f %.3f %.3f\n", px, py, r)
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define X real()
#define Y imag()
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using comd = complex<double>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(all(v),v.end());
}

double EPS = 1e-10;
double add(double a, double b){
  if(abs(a+b) < EPS* (abs(a) + abs(b))) return 0;
  return a+b;
}

struct P{
  double x,y;
  P(){}
  P(double _x,double _y):x(_x),y(_y){}
  P operator + (P p){
    return P(add(x,p.x) ,add(y,p.y));
  }
  P operator - (P p){
    return P(add(x,-p.x) ,add(y,-p.y));
  }
  P operator * (double d){
    return P(x * d,y * d);
  }
  friend ostream& operator<<(ostream& os,const P& p){
    os << "("<<p.x <<","<<p.y<<")";
    return os;
  }
  double dot(P p){
    return add(x * p.x,y*p.y);
  }
  double det(P p){
    return add(x*p.y,-y*p.x);
  }
  double dist2(P p){
    return ((*this-p).x * (*this-p).x) + ((*this-p).y * (*this-p).y);
  }
  P GetCenter(P &p){
    return P((*this+p).x/2,(*this+p).y/2);
  }
  double GetSlope(P &p){
    return (y-p.y)/(x-p.x);
  }
};
//???????????????????????¨?????????
bool on_seg(P p1,P p2,P q){
  return (p1-q).det(p2-q) == 0 && (p1-q).dot(p2-q) <= 0;
}
//???????°????
P intersection(P p1, P p2, P q1,P q2){
  return p1 + (p2-p1) * ((q2 - q1).det(q1-p1) / (q2 - q1).det(p2-p1)) ;
}
int is_prime[100001];
void Eratosthenes(int N){
  for(int i = 0; i < N; i++){
    is_prime[i] = 1;
  }
  is_prime[1] = 0;
  for(int i = 2; i*i < N ; i++){
    if(is_prime[i]){
      for(int j = 0; i * (j + 2) < N; j++){
        is_prime[i *(j + 2)] = 0;
      }
    }
  }
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  P p1,p2,p3;
  cin >> n;
  rep(i,n){
    cin >> p1.x>>p1.y>>p2.x>>p2.y>>p3.x>>p3.y;
    P p12,p23,pa,pc;
    p12 = p1.GetCenter(p2);
    p23 = p3.GetCenter(p2);
    double b;
    double slp23 = p2.GetSlope(p3);
    if(slp23 != 0 && abs(slp23) != inf){
      b = p1.x/slp23 + p1.y;
      pc = P(10000,10000/(-slp23)+b);
    }
    else{
      if(slp23 == 0){
        pc = P(p23.x,10000);
      }
      else{
        pc = P(10000,p23.y);
      }
    }
    double slp12 = p2.GetSlope(p1);
    if(slp12 != 0 && abs(slp12) != inf){
      b = p3.x/slp12 + p3.y;
      pa = P(10000,10000/(-slp12)+b);
    }
    else{
      if(slp12 == 0){
        pa = P(p12.x,10000);
      }
      else{
        pa = P(10000,p12.y);
      }
    }
    P ans = intersection(p12,pa,p23,pc);
    fcout(3) << ans.x << " " << ans.y << " ";
    cout << sqrt(ans.dist2(p1))<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;
namespace std {
    bool operator < (const P& a, const P& b) {
        return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
    }
}
double cross(const P& a, const P& b) {
    return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
    return real(conj(a)*b);
}

typedef vector<P> G;

double area2(const G& P) {
    double A = 0;
    for (int i = 0; i < P.size(); ++i)
        A += cross(P[i], P[(i+1)%P.size()]);
    return A;
}

int main(){
    double x, y;
    G g;
    while(scanf("%lf,%lf", &x, &y) != EOF){P p(y, x); g.push_back(p);}
    printf("%lf\n", abs(area2(g)/2.));
}

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

float a, b, c, d, e, f;
float x, y;
float rx, ry;


float RoundNumber(float f) {
  int tf = (int)(10000 * f);
  if (tf % 10 >= 5) {
    tf += 10;
  }
  tf /= 10;
  return (float)tf / 1000.0f;
}

void solve(){
  float tmp1 = f-(c*d/a);
  float tmp2 = e-(b*d/a);
  y = tmp1/tmp2;
  x = (c - b * y) / a;  
  printf("%.3f %.3f ", RoundNumber(x), RoundNumber(y));        
}

int main(int argc, char const* argv[]) {
  int n;
  cin>>n;
  for (int i = 0; i < n; i += 1) {
    float x1, y1, x2, y2, x3, y3;
    cin>>x1>>y1>>x2>>y2>>x3>>y3;
    a = -2*x1 + 2*x2;
    b = -2*y1 + 2*y2;
    c = x2*x2 + y2*y2 - x1*x1 - y1*y1;
    d = -2*x1 + 2*x3;
    e = -2*y1 + 2*y3;
    f = x3*x3 + y3*y3 - x1*x1 - y1*y1;

    solve();
    
    float r = (x - x1)*(x - x1) + (y - y1)*(y - y1);
    r = sqrt(r);
    printf("%.3f\n", RoundNumber(r));
  }  
  return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;

int main()
{
	int n; cin >> n;
	double x[3];
	double y[3];
	double r;

	while(n--){
	 for(int j=0;j<3;j++){
	 	cin >> x[j] >> y[j];
	 }

	 double a = 2*(x[1]-x[0]);
	 double b = 2*(y[1]-y[0]);
	 double c = 2*(x[2]-x[0]);
	 double d = 2*(y[2]-y[0]);

	 double e = pow(x[1],2.0)-pow(x[0],2.0)+pow(y[1],2.0)-pow(y[0],2.0);
	 double f = pow(x[2],2.0)-pow(x[0],2.0)+pow(y[2],2.0)-pow(y[0],2.0);

	 if(a==0){
	 	swap(a,c);
	 	swap(b,d);
	 	swap(e,f);
	 }

	b = b/a;
	e = e/a;
	a = a/a;
	 
	 
	d = d-b*c;
	f = f-e*c;
	c = c-a*c;

	f = f/d;
	d = d/d;

	b = b-d*b;
	e = e-f*b;

	r = sqrt(pow((e-x[0]),2.0)+pow((f-y[0]),2.0));
	
	cout << fixed;
	cout << setprecision(3) << e <<" "<< f << " " << r << endl;
	}
	return 0;

}