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 <cmath>
#include <cstdio>

using namespace std;

int main(){
  int n;
  cin>>n;
  for (int i=0;i<n;i++){
    double x1,x2,x3,y1,y2,y3;
    cin>>x1>>y1>>x2>>y2>>x3>>y3;
    double a,b,c,d,e,f;
    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;
    double x=(c*d-a*f)/(b*d-a*e),y=(c*e-b*f)/(a*e-b*d);
    double r=(x1-x)*(x1-x)+(y1-y)*(y1-y);
    r=sqrt(r);
    printf("%.3f %.3f %.3f\n",x,y,r);
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <math.h>

using namespace std;

int main(){
  double x1,y1,x2,y2,x3,y3;
  vector<double> x1l,y1l,x2l,y2l,x3l,y3l;
  int n;

  cin >> n;

  for(int i=0; i<n; i++){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    x1l.push_back(x1);
    y1l.push_back(y1);
    x2l.push_back(x2);
    y2l.push_back(y2);
    x3l.push_back(x3);
    y3l.push_back(y3);
  }

  double ex,ey,fx,fy;
  double a,b,c,d,e,f,r;

  for(int i=0; i<n; i++){
    x1=x1l[i];
    y1=y1l[i];
    x2=x2l[i];
    y2=y2l[i];
    x3=x3l[i];
    y3=y3l[i];

    a = x1*x1+y1+y1;
    b = x2*x2+y2+y2;
    c = x3*x3+y3+y3; 
    d = 0.5/(x1*y2-x2*y1+x2*y3-x3*y2+x3*y1-x1*y3);
    e = d*(a*y2-b*y1+b*y3-c*y2+c*y1-a*y3);
    f = d*(x1*b-x2*a+x2*c-x3*b+x3*a-x1*c);
    r = sqrt((e-x1)*(e-x1)+(f-y1)*(f-y1));
    printf("%0.3f %0.3f %0.3f\n",e,f,r);
  }

  return 0;
}

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

using namespace std;

#define EPS (1e-10)

struct Point {
    double x, y;

    Point(){}
    Point(double x, double y) : x(x), y(y) {}

    Point operator + (const Point &p) const {
        return Point(x + p.x, y + p.y);
    }

    Point operator - (const Point &p) const {
        return Point(x - p.x, y - p.y);
    }
    
    Point operator * (const double &k) const {
        return Point(x * k, y * k);
    }
};

double dot(const Point &a, const Point &b)
{
    return a.x * b.x + a.y * b.y;
}

double norm(const Point &p)
{
    return dot(p, p);
} 

double abs(const Point &p)
{
    return sqrt(norm(p));
}

typedef vector<Point> Polygon;

struct Circle {
    Point p;
    double r;
    Circle(Point p, double r) : p(p), r(r) {}
};

Circle smallest_enclosing_circle(const Polygon &pg)
{    
    Point p(0, 0);
    int N = pg.size();
    for (int i = 0; i < (int)pg.size(); i++) {
	p = p + pg[i];
    }
    p = p * (1. / pg.size());
    double d = 0.5;
    while (d > EPS) {
	for (int i = 0; i < 150; i++) {
	    int s = 0;
	    for (int j = 0; j < N; j++) {
		if (abs(pg[s] - p) - abs(pg[j] - p) < -EPS) {
		    s = j;
		}
	    }
	    p = p + (pg[s] - p) * d;
	}
	d *= 0.5;
    }
    double r = abs(p - pg[0]);
    return Circle(p, r);
}

int main()
{
    Polygon pg(3);
    int N;
    cin >> N;
    while (N--) {
        for (int i = 0; i < 3; i++) {
            cin >> pg[i].x >> pg[i].y;
        }
        auto c = smallest_enclosing_circle(pg);
        printf("%.3f %.3f %.3f\n", c.p.x, c.p.y, c.r);
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ld = long double;
const ld eps = 1e-8, pi = acos(-1.0);

bool eq(ld a, ld b) {
	return abs(a - b) < eps;
}

using Point = complex<ld>;
class Line {
public:
	Point a, b;
};
ld dot(Point a, Point b) {
	return real(conj(a) * b);
}

ld cross(Point a, Point b) {
	return imag(conj(a) * b);
}

int ccw(Point a, Point b, Point c) {
	b -= a, c -= a;
	if (cross(b, c) > eps) return 1;	// a,b,c??????????¨???¨???
	if (cross(b, c) < -eps) return -1;	// a,b,c???????¨???????
	if (dot(b, c) < 0) return 2;		// c,a,b????????§??´???
	if (norm(b) < norm(c)) return -2;	// a,b,c???????????´???
	return 0;							// a,c,b???????????´???
}

bool isis_ll(Line l, Line m) {
	return abs(cross(l.b - l.a, m.b - m.a)) > eps;
}

bool isis_ls(Line l, Line s) {
	return (cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) < eps);
}

bool isis_lp(Line l, Point p) {
	return abs(cross(l.b - p, l.a - p)) < eps;
}

bool isis_sp(Line s, Point p) {
	return abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps;
}

Point proj(Line l, Point p) {
	ld t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + t * (l.a - l.b);
}

Point is_ll(Line s, Line t) {
	Point sv = s.b - s.a, tv = t.b - t.a;
	assert(cross(sv, tv) != 0);
	return s.a + sv * cross(tv, t.a - s.a) / cross(tv, sv);
}

int main()
{
	cout << fixed << setprecision(3);
	int n;
	ld x1, x2, x3, y1, y2, y3;
	cin >> n;
	while (n--) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		Point p1(x1, y1), p2(x2, y2), p3(x3, y3);
		Point c = is_ll((Line){ (p1 + p2) / (ld)2, (p1 + p2) / (ld)2 + (p2 - p1) * Point(0, 1) }, (Line){ (p2 + p3) / (ld)2, (p2 + p3) / (ld)2 + (p3 - p2) * Point(0, 1) });
		cout << c.real() << ' ' << c.imag() << ' ' << abs(p1 - c) << endl;
	}
	return 0;
}

C++: 
    for(int i=0; i<3; i++) {
      for(int j=0; j<3; j++) {
	cout << A[i][j] << " ";
      }
      cout << endl;
    }

C++: #include<iostream>
#include<stdio.h>
#include<math.h>

using namespace std;

int main(){

    double x1, y1, x2, y2, x3, y3;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

    double p = ((y1 - y3)*(pow(y1, 2) - pow(y2, 2) + pow(x1, 2) - pow(x2, 2)) - (y1 - y2)*(pow(y1, 2) - pow(y3, 2) + pow(x1, 2) - pow(x3, 2))) / (2 * (y1 - y3)*(x1 - x2) - 2 * (y1 - y2)*(x1 - x3));
    double q = ((x1 - x3)*(pow(x1, 2) - pow(x2, 2) + pow(y1, 2) - pow(y2, 2)) - (x1 - x2)*(pow(x1, 2) - pow(x3, 2) + pow(y1, 2) - pow(y3, 2))) / (2 * (x1 - x3)*(y1 - y2) - 2 * (x1 - x2)*(y1 - y3));
    double r = pow((pow((x1 - p), 2) + pow((y1 - q), 2)), 0.5);

    printf("%.3f %.3f %.3f\n", p, q,r);

    return 0;
}