Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

C++: #include<iostream>
#include<iomanip>

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	double copya, copyb, copyc;
	double odd;//倍率
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f)
	{
		copya = a, copyb = b, copyc = c;

		odd = a / d;

		d *= odd, e *= odd, f *= odd;

		a -= d, b -= e, c -= f;

		y = c / b;
		x = (copyc - copyb*y) / copya;

		cout << fixed << setprecision(3);
		cout << x << " " << y << endl;

	}


	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    double a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        double x,y;
        x=(c-b*(a*f-c*d)/(a*e-b*d))/a;
        y=(a*f-c*d)/(a*e-b*d);
        printf("%.3f %.3f\n",x,y);
    }
}

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

using namespace std;

int main()
{
	int a[1000],b[1000],c[1000],d[1000],e[1000],f[1000];
	float x[1000],y[1000];
	int len=0;
	while (cin >> a[len] >> b[len] >> c[len] >> d[len] >> e[len] >> f[len])
		len++;

	for (int i=0; i < len; i++) {
		x[i] =  (double)((e[i] * c[i] - b[i] * f[i]) / (double)(e[i] * a[i] - b[i] * d[i]));
		y[i] =  ((c[i] * d[i] - f[i] * a[i]) / (b[i] * d[i] - a[i] * e[i]));
	}
	for (int i=0; i < len; i++) {
		printf("%.3lf %.3lf\n",x[i],y[i]);
	}
	return 0;
}

C++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

int main(){
  double a,b,c,d,e,f,x,y;
  
  while(cin>>a>>b>>c>>d>>e>>f){
    if(b==0){
      x=c/a;
      y=(f-d*x)/e;
    }
    else{
      x=(c*e-b*f)/(a*e-b*d);
      y=(c-a*x)/b;
    }
    
    x=round(x*1000)/1000;
    y=round(y*1000)/1000;
    
    if(x==-0.000) x=0.000;
    if(y==-0.000) y=0.000;
    
    cout<< fixed << setprecision(3) << x <<" "<< y << endl;
  }
    
  return 0;
}