Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	for {
		data := nextInts(6)
		if data[0] == 0 || data[1] == 0 || data[2] == 0 || data[3] == 0 || data[4] == 0 || data[5] == 0 {
			break
		}
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return ((c * e) - (b * f)) / ((a * e) - (b * d))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return ((c * d) - (a * f)) / ((b * d) - (a * e))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 
 using namespace std;

 int main()
 {
   int a,b,c,d,e,f;
   while(cin>>a>>b>>c>>d>>e>>f)
   {
     double y=1.0*(c*d-f*a)/(b*d-a*e);
     double x=1.0*(c*e-f*b)/(a*e-d*b);
     if(abs(x)<0.000000001) x=0.0;
     if(abs(y)<0.000000001) y=0.0;
     printf("%.3lf %.3lf\n",x,y);            
   }
   //while(1);      
   return 0;    
 }

C++: #include <stdio.h>

int main(void){
	int a, b, c, d, e, f;
	double alpha, beta;
	double x, y;
	double ratio;

	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != -1){
		

		ratio = -1 * ((double)d / (double)a);
		alpha = ratio * b;
		beta = ratio * c;
		//printf("%f %f %f\n", ratio, alpha, beta);

		y = (double)(beta + f) / (alpha + e);
		x = (double)(f - e * y) / d;

		printf("%.3f %.3f\n", x, y);
	}

	return 0;
}

C++: #define scanf_s scanf
#include <stdio.h>
#include <iostream>
using namespace std;
#define MAX 200
int main(void)
{
	double a, b, c, d, e, f, x, y;
	while (scanf_s("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) {
		x = (e * c - b * f) / (e * a - b * d);
		y = (d * c - a * f) / (d * b - a * e);
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int main(){
	double x,y,a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		x=(c-(b*f/e))/(a-(b*d/e));
		y=(c-a*x)/b;
		x*=1000;
		x+=0.5;
		x=int(x);
		x/=1000;
		y*=1000;
		y+=0.5;
		y=int(y);
		y/=1000;
		cout<<fixed<<setprecision(3)<<x<<" ";
		cout<<fixed<<setprecision(3)<<y<<endl;
	}
	return 0;
}

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

int main(){
	
	double x,y,a,b,c,d,e,f;
	while(std::cin >> a >> b >> c >> d >> e >> f){
	y = (d*c - a*f)/(d*b - a*e);
	x = (c - b*y)/a;
	std::printf("%-.3f %-.3f", x, y);
	}
	
	return 0;
}

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

C++: #include<iostream>
#include<iomanip>
using namespace std;

int main()
{
	double x, y;
	double a, b, c, d, e, f;
	int J = 1;

	while (J){

		J = (int)(cin >> a >> b >> c >> d >> e >> f);

		if (J == 0)
			break;

		y = ((d * c) - (a * f)) / ((b * d) - (e * a));
		x = (c - b * y) / a;

		x *= 10000;
		x = x + 0.5 - (x < 0);
		x = (int)x;
		x /= 10000;

		y *= 10000;
		y = y + 0.5 - (y < 0);
		y = (int)y;
		y /= 10000;


		cout << setprecision(4) << showpoint << x << " " << y << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <array>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

//?????¨?????\
double round_four(double value){
    //0??????
    if ((static_cast<int>(value + 0.5)) < 1){
        return 0.0;
    }
    //?????????
    value *= 1000;
    value += (value / fabs(value)) * 0.5;
    int nValue = static_cast<int>(value);
    value = static_cast<double>(nValue) / 1000;
    return value;
}

//????¬?????¨?????§£
array<double, 2> comp_linear_equation(int a, int b, int c, int d, int e, int f){
    array<double, 2> result;
    result[0] = static_cast<double>(e * c - (f * b));
    result[1] = static_cast<double>(-(d * c) + a * f);
    double num = 1.0 / ((a * e) - (b * d));
    result[0] *= num;
    result[1] *= num;
    result[0] = round_four(result[0]);
    result[1] = round_four(result[1]);
    return result;
}

//?????????
int main(){
    int a, b, c, d, e, f;
    vector<array<double, 2>> result;
    while (cin >> a >> b >> c >> d >> e >> f){
        result.push_back(comp_linear_equation(a, b, c, d, e, f));
    }
    for (const auto& element : result){
        for (auto num : element){
            cout << fixed << setprecision(3) << num << " ";
        }
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#define EE 0.0000001

using namespace std;
  
int main(void){
    double a,b,c,d,e,f,delta,kai,kait;
    while(1){
	    if( scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&e,&c,&d,&f) == EOF) break;
		delta=a*d-b*c;
		kai=(d*e-b*f)/(delta);
		kait=(a*f-e*c)/(delta);
		if((kai >= 0-EE) && (kai <= 0+EE)) kai = 0.0;
		printf("%.3f %.3f\n",kai,kait);
    }
    return 0;
}

C++: #include<stdio.h>
int main(){
	int X,Y;
double a,b,c,d,e,f,x,y;
double p[2][3]={0};
y=0;x=0;
 while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){

y=(d*c-a*f)/(b*d-a*e);
x=(e*c-b*f)/(e*a-b*d);

printf("%.3f %.3f\n",x,y);
}
return 0;
}

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

using namespace std;

double a, b, c, d, e, f;


double x(double, double, double, double, double, double) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double, double, double, double, double, double) {

	return (a*f - c*d) / (a*e - b*d);
}

double round(double , int ){
	int fct;
	double dat;
	int keta;

	fct = (int)pow(10, keta - 1);
	dat *= fct;
	dat += (dat < 0) ? -0.5 : 0.5;
	dat = (int)(dat);
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2;
	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

	cin >> a >> b >> c >> d >> e >> f;

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);

	cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl;
	cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl;

	return 0;
}

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

const double EPS=1e-8;
typedef vector<double>vec;
typedef vector<vec>mat;

/// Ax=b
vec gauss_jordan(const mat& A,const vec& b){
    int n=A.size();
    mat B(n,vec(n+1));

    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)B[i][j]=A[i][j];

    for(int i=0;i<n;i++)B[i][n]=b[i];

    for(int i=0;i<n;i++){
        int pivot=i;
        for(int j=i+1;j<n;j++){
            if(abs(B[j][i])<abs(B[pivot][i]))pivot=j;
        }
        swap(B[i],B[pivot]);
        if(abs(B[i][i])<EPS)return vec();

        for(int j=i+1;j<=n;j++)B[i][j]/=B[i][i];
        for(int j=0;j<n;j++){
            if(i==j)continue;
            for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];
        }
    }

    vec x(n);
    for(int i=0;i<n;i++)x[i]=B[i][n];
    return x;
}

int main(){
    mat A(2,vec(2));
    vec b(2);

    for(int i=0;i<2;i++){
        scanf("%lf%lf%lf",&A[i][0],&A[i][1],&b[i]);
    }

    vec x=gauss_jordan(A,b);
    if(x.size()<2)return 0;
    printf("%lf %lf\n",x[0],x[1]);
    return 0;
}