Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var num int
	fmt.Scan(&num)
	for i := 0; i < num; i++ {
		var x1, y1, x2, y2, x3, y3 float64
		fmt.Scanf("%f%f%f%f%f%f", &x1, &y1, &x2, &y2, &x3, &y3)

		a := 2 * (x2 - x1)
		b := 2 * (y2 - y1)
		c := 2 * (x3 - x1)
		d := 2 * (y3 - y1)
		e := x2*x2 - x1*x1 + y2*y2 - y1*y1
		f := x3*x3 - x1*x1 + y3*y3 - y1*y1

		// 直線1: ax + by - e = 0
		// 直線2: cx + dy - f = 0
		px := (d*e - b*f) / (a*d - b*c)
		py := (c*e - a*f) / (b*c - a*d)
		r := math.Sqrt((px-x1)*(px-x1) + (py-y1)*(py-y1))
		fmt.Printf("%.3f %.3f %.3f\n", px, py, r)
	}
}

C++: #include "bits/stdc++.h"
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)
 
#define EPS (1e-10)
class P{                    //?????§?????????
public:
    double x,y;
     
    P(double _x=0,double _y=0):x(_x),y(_y){};
    P operator + (const P &p     )const{ return P( x+p.x , y+p.y ); }  //?????\?????°???§??????????
    P operator - (const P &p     )const{ return P( x-p.x , y-p.y ); }  //????????????????´???§??????????
    P operator * (const double k )const{ return P( x*k   , y*k    ); } //????????????????????§??????????
    P operator / (const double k )const{ return P( x/k   , y/k    ); } //????????????????????§??????????
     
    bool operator == (const P &p){ return ( fabs(x-p.x)<EPS && fabs(y-p.y)<EPS ); }
    bool operator < (const P &p) const{ return ( x!=p.x ? x<p.x:y<p.y ); }
     
    double norm(){ return x*x+y*y; }        //?????£????´?????£????´????????£????´?
    double abs() { return sqrt(norm()); }   //?????\???????????§?????£??????¬??£?????
    void normalize() {double d = sqrt(x*x+y*y); x /= d; y /= d;}    //?????????????????£?????¨??????????????\???????
};
struct C{P p;double r;};    //?????\?????
struct S{P p1,p2;};         //?????§??????????????\???????
typedef vector<P> Polygon;  //?????\??????????????¨?????§????´\??\???????????¢
typedef P Vector;           //?????£????´?????£??????????????£????´?????£????´???
typedef S L;                //?????§????´¢??´?????§??????????
 
double dot  (Vector a,Vector b) { return a.x*b.x+a.y*b.y; }
double cross(Vector a,Vector b) { return a.x*b.y-a.y*b.x; }
double sqDist(P a, P b)         {return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);}
double dist (P a, P b)          {return sqrt(sqDist(a,b));}
Vector vec(S a)                 {return P(a.p2.x-a.p1.x,a.p2.y-a.p1.y);}
 
 
//?????§??????????????\?????????£????????????\????\???\??§????´¢??´????????????????????§??????????????\?????????§????´¢??´?????§??????????????£???????´\????????±?????\??£?????????£???????
S getBisector(P a, P b){
    Vector vect = vec(S{a,b});
    P n = P(vect.y, -vect.x);
    n.normalize();
    P cent = (a+b)/2.0;
    return S{cent,cent+n};
}
 
 
// ?????§????´¢??´?????§??????????????£??????¨?????§????´¢??´?????§??????????????£??????????????????????????????§????????? vefiried AOJ CGL_2
P getCrossPointSS(S l1, S l2){
    double A = cross(vec(l1), vec(l2));
    double B = cross(vec(l1), l1.p2 - l2.p1);
    if(abs(A)<EPS && abs(B)<EPS) return l2.p1; // ????????????????????§????´¢??´?????§??????????????£????????????????¬??£????????????£??????£?????£????????????£???????£???????
    if(abs(A)<EPS) assert(false); // ?????§????´¢??´?????§??????????????£???????????????????????????£???????????£???????????£????????????£?????
    return l2.p1 + vec(l2) * B / A;
}
 
 
int main(){
    int n;
    cin>>n;
    rep(hoge,n){
        vector<P> points(3);
        rep(i,3)cin>>points[i].x>>points[i].y;
         
        vector<S> bisectors(2);
        rep(i,2) bisectors[i] = getBisector(points[i], points[i+1]);
         
        P cent = getCrossPointSS(bisectors[0], bisectors[1]);
         
         
        printf("%.3lf %.3lf %.3lf\n",cent.x,cent.y,dist(cent,points[1]));
    }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main()
{
    int n;
	double ax,ay,bx,by,cx,cy,x,y,r;
	double A1,B1,C1,A2,B2,C2;
	cin>>n;
	while(n--){
		cin>>ax>>ay>>bx>>by>>cx>>cy;
		A1=2*(bx-ax);
		B1=2*(by-ay);
		C1=ax*ax-bx*bx+ay*ay-by*by;
		A2=2*(cx-ax);
		B2=2*(cy-ay);
		C2=ax*ax-cx*cx+ay*ay-cy*cy;
		x=(B1*C2-B2*C1)/(A1*B2-A2*B1);
		y=(C1*A2-C2*A1)/(A1*B2-A2*B1);
		r=sqrt((ax-x)*(ax-x)+(ay-y)*(ay-y));
		printf("%.3f %.3f %.3f\n",x,y,r);
	}
    return 0;
}

C++: #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// ------ Classes ------ //
class Point {
public:
	long double px, py;
	Point() : px(0), py(0) {};
	Point(long double px_, long double py_) : px(px_), py(py_) {};
	bool operator==(const Point& p) const { return px == p.px && py == p.py; }
	bool operator!=(const Point& p) const { return px != p.px || py != p.py; }
	bool operator<(const Point& p) const { return px < p.px ? true : (px == p.px && py < p.py); }
	bool operator>(const Point& p) const { return px > p.px ? true : (px == p.px && py > p.py); }
	bool operator<=(const Point& p) const { return !(Point(px, py) > p); }
	bool operator>=(const Point& p) const { return !(Point(px, py) < p); }
	Point operator+(const Point& p) const { return Point(px + p.px, py + p.py); }
	Point operator-(const Point& p) const { return Point(px - p.px, py - p.py); }
	Point operator/(long double d) const { return Point(px / d, py / d); }
	friend Point operator*(const Point p, long double d) { return Point(p.px * d, p.py * d); }
	friend Point operator*(long double d, const Point& p) { return p * d; }
	Point& operator+=(const Point& p1) { px += p1.px, py += p1.py; return *this; }
	Point& operator-=(const Point& p1) { px -= p1.px, py -= p1.py; return *this; }
	Point& operator*=(long double d) { px *= d, py *= d; return *this; }
	Point& operator/=(long double d) { px /= d, py /= d; return *this; }
};
class Circle {
public:
	Point p; long double r;
	Circle() : p(Point()), r(0.0L) {};
	Circle(Point p_) : p(p_), r(0.0L) {};
	Circle(Point p_, long double r_) : p(p_), r(r_) {};
	Circle(long double x_, long double y_) : p(Point(x_, y_)), r(0.0L) {};
	Circle(long double x_, long double y_, long double r_) : p(Point(x_, y_)), r(r_) {};
	bool operator==(const Circle& c) const { return p == c.p && r == c.r; }
	bool operator!=(const Circle& c) const { return !(Circle(p, r) == c); }
};
// ------ Functions ------ //
long double norm(const Point& a) { return a.px * a.px + a.py * a.py; }
long double abs(const Point& a) { return sqrtl(norm(a)); }
long double arg(const Point& a) { return atan2l(a.py, a.px); }
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
long double dst(const Point& a, const Point& b) { return abs(b - a); }
Point pol(long double r, long double d) { return Point(cosl(d) * r, sinl(d) * r); }
vector<Point> crp(Circle c1, Circle c2) {
	double d = abs(c1.p - c2.p);
	double a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
	double t = arg(c2.p - c1.p);
	return{ c1.p + pol(c1.r, t + a), c1.p + pol(c1.r, t - a) };
}
// ------ Main ------ //
int n; Point p1, p2, p3;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> p1.px >> p1.py >> p2.px >> p2.py >> p3.px >> p3.py;
		long double d1 = dst(p1, p2), d2 = dst(p2, p3), d3 = dst(p3, p1);
		long double r = d1 * d2 * d3 / sqrtl((d1 + d2 + d3) * (d1 + d2 - d3) * (d2 + d3 - d1) * (d3 + d1 - d2));
		vector<Point> v = crp(Circle(p1, r), Circle(p2, r));
		for (int j = 0; j < v.size(); j++) {
			long double d4 = dst(v[j], p3);
			if (d4 - 1e-10 <= r && r <= d4 + 1e-10) {
				printf("%.3Lf %.3Lf %.3Lf\n", v[j].px, v[j].py, r); break;
			}
		}
	}
	return 0;
}