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 <iostream>
#include <cstdio>
//#include <cstdlib>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
//#include <stack>
//#include <limits>
#include <sstream>
//#include <functional>
#include <complex>
using namespace std;

#define len(array)  (sizeof (array) / sizeof *(array))
#define rep(i, s, e) for(int i = s;i < e;i++)
#define rrep(i, e, s) for(int i = e;s <= i;i--)
#define vrange(v) v.begin(), v.end()
#define vrrange(v) v.rbegin(), v.rend()
#define vsort(v) sort(vrange(v))
#define vrsort(v) sort(vrrange(v))
#define arange(a) a, a + len(a)
#define asort(a) sort(arange(a))
#define arsort(a, t) sort(arange(a), greater<t>())
#define afill(a, v) fill(arange(a), v)
#define afill2(a, v, t) fill((t *)a, (t *)(a + len(a)), v)
#define fmax(a, b) (a < b? b : a)
#define fmin(a, b) (a > b? b : a)
#define fabs(a) (a < 0? -a : a)
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-10;
//const int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
//const int dy[] = {0, 0, 1, -1, -1, -1, 1, 1};
//const int weight[] = {0,1,10,100,1000,10000,100000,1000000,10000000};
//priority_queue< int, vector<int>, greater<int> > q;


// http://d.hatena.ne.jp/otaks/20100929

typedef complex<double> p;
//XY座標
#define X real()
#define Y imag()

class Triangle{

private:
  //三角形の3点の座標
  p a, b, c;
  //三角形の3辺の長さ
  double ab, bc, ca;
  //三角形の3角の大きさ(ラジアン)
  //double A, B, C;
  double cosA, cosB, cosC, sinA, sinB, sinC;

public:
  //コンストラクタ(3つの点と辺と角度を初期化)
  Triangle(p p1, p p2, p p3){
	a = p1;
	b = p2;
	c = p3;
	ca = abs(c-a);
	bc = abs(b-c);
	ab = abs(a-b);
	cosA = getCosine(p2 - p1, p3 - p1);
	cosB = getCosine(p1 - p2, p3 - p2);
	cosC = getCosine(p1 - p3, p2 - p3);
	sinA = getSine(p2 - p1, p3 - p1);
	sinB = getSine(p1 - p2, p3 - p2);
	sinC = getSine(p1 - p3, p2 - p3);
  }

  //3点が一直線上だったら三角形ではない
  bool isTriangle(){
	double t = det(a - c, b - c);
	return abs(t) < EPS? false : true;
  }

  //p1とp2の外積
  double dot(p p1, p p2){
	return p1.X*p2.X + p1.Y*p2.Y;
  }

  //p1とp2の外積
  double det(p p1, p p2){
	return p1.X*p2.Y - p2.X*p1.Y;
  }

  //余弦定理からcosを求める関数
  double LawOfCosines(double a,double b, double c){
	return (b*b+c*c-a*a) / (2.0*b*c);
  }
  //外積からsineを求める
  double getSine(p p1, p p2){
	return abs(det(p1, p2) / (abs(p1)*abs(p2)));
  }
  //内積からcosineを求める
  double getCosine(p p1, p p2){
	return dot(p1, p2) / (abs(p1)*abs(p2));
  }
  //2つのdouble型の数値が等しいかどうか
  bool equal(double a, double b){
	return (abs( a-b ) < EPS)? true : false ;
  }

  //double circumscribedCircleRadius(){//外接円の半径を返す
  double getCR(){
	//return ( bc / (2*sin(A)));
	return ( bc / (2*sinA));
  }
  //p circumscribedCircle(){//外心(外接円の中心)の座標を返す
  p getCC(){ // get a circumcenter
	double sA = 2*sinA*cosA;
	double sB = 2*sinB*cosB;
	double sC = 2*sinC*cosC;
	double deno = sA + sB + sC;
	return p((a.X * sA + b.X * sB + c.X * sC) / deno, (a.Y * sA + b.Y * sB + c.Y * sC) / deno );
  }
};


//AOJ0010
void aoj0010(){
  int n;
  double x1, y1, x2, y2, x3, y3, px, py, r;
  cin >> n;
  while(n--){
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
	Triangle t = Triangle(p(x1, y1), p(x2, y2), p(x3, y3));
	p cc = t.getCC();
	printf("%.3f %.3f %.3f\n", cc.X, cc.Y, t.getCR());
  }
}

void doIt(){
  Triangle t = Triangle(p(0, 1), p(1, 2), p(2, 3));
  cout << t.isTriangle() << endl;
}

int main() {
  aoj0010();
  return 0;
}

C++: #include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
	int a,b,c,d,e,f,g;
	double A,B,C,D,E,F,G,H,I,L,M,N,O,P,Q,R,J,K,X,Y;
	scanf("%d",&a);
	
	for(b=0;b<a;b++){
		scanf("%lf %lf %lf %lf %lf %lf",&A,&B,&C,&D,&E,&F);
		G=-2.0*A*D+2.0*C*D+2.0*A*F-2.0*C*F+2.0*B*C-2.0*B*E-2.0*C*D+2.0*E*D;
		H=D-F;
		I=B+D;
		J=B-D;
		K=B-D;
		L=D+F;
		M=D-F;
		O=-H*I*J+K*L*M-A*A*D+A*D*C+A*A*F-A*C*F-A*C*D+C*C*D+A*C*F-C*C*F+B*C*C-B*C*E-C*C*D+E*C*D+B*C*E-B*E*E-C*E*D+E*E*D;
		X=O/G;
		if(G==0.0)X=0.0;
		//if(O==0.0)X=0.0;
		
		H=-2*F+2*D;
		I=C-X;
		I=I*I;
		J=E-X;
		J=J*J;
		I=I-J;
		I=I+D*D-F*F;
		Y=I/H;
		//if(H==0.0)Y=0.0;
		
		H=X-A;
		I=Y-B;
		H=H*H;
		I=I*I;
		H=H+I;
		R=sqrt(H);
		
		
		
		
		
	}
	printf("%.3lf %.3lf %.3lf\n",X,Y,R);
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>


#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;


double A[2][2];
double C[2];


int main()
{
	int n;
	cin >> n;
	REP(i, n){
		double x1, x2, x3, y1, y2, y3;
		cin >> x1>> x2 >> x3 >> y1 >> y2 >> y3;

		double x21 = x2 - x1;
		double x31 = x3 - x1;
		double y21 = y2 - y1;
		double y31 = y3 - y1;

		double xc = ((y31*(x21*x21 + y21*y21)) - (y21*(x31*x31 + y31*y31))) /
			(2 * (x21*y31 - y21*x31));

		double yc = ((x21*(x31*x31 + y31*y31)) - (x31*(x21*x21 + y21*y21))) /
			(2 * (x21*y31 - y21*x31));	
		
		double d = (xc - x1)*(xc - x1) + (yc - y1)*(yc - y1);
		double xc_ = xc * 1000;
		double yc_ = yc * 1000;
		xc_ += ((int)xc_ % 10) > 4 ? 10 : (int)-xc_%10;
		yc_ += ((int)yc_ % 10) > 4 ? 10 : (int)-yc_%10;

		printf("%.3lf %.3lf %.3lf\n", xc_/1000, yc_/1000, sqrt(d));


	}

}