Go: package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	n := r.nextInt()

	type Vec struct {
		x, y float64
	}
	vec := func(a, b Vec) Vec { return Vec{b.x - a.x, b.y - a.y} }
	unv := func(a Vec) Vec { return Vec{-a.y, a.x} }
	cdot := func(a, b Vec) float64 { return a.x*b.x + a.y*b.y }
	times := func(t float64, a Vec) Vec { return Vec{t * a.x, t * a.y} }
	add := func(a, b Vec) Vec { return Vec{a.x + b.x, a.y + b.y} }
	for i := 0; i < n; i++ {

		r.Scan(true)
		nextFloat64 := func() (ret float64) { fmt.Sscanf(r.nextString(), "%f", &ret); return }
		a1, a2, a3 := Vec{nextFloat64(), nextFloat64()}, Vec{nextFloat64(), nextFloat64()}, Vec{nextFloat64(), nextFloat64()}
		unv23 := unv(vec(a2, a3))
		v12 := vec(a1, a2)
		v31 := vec(a3, a1)
		s := cdot(v12, v31) / 2 / cdot(v12, unv23)
		c := add(times(.5, add(a2, a3)), times(s, unv23))
		v1c := vec(a1, c)
		fmt.Fprintf(stdout, "%.3f %.3f %.3f\n", c.x, c.y, math.Sqrt(v1c.x*v1c.x+v1c.y*v1c.y))
	}
}

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;
}