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 <iomanip>

using namespace std;

int main() {

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


	
	while (cin >> a >> b >> c >> d >> e >> f){

			aa=(c*e-b*f)/(a*e-b*d);
	bb=(a*f-c*d)/(a*e-b*d);

	//cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d))  << " " << ((a*f-c*d)/(a*e-b*d)) << endl;


		printf("%03d %*s %03d",	aa,1,bb);
	
	}

	return 0;
}

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

int main(){
double a,b,c,d,e,f,x,y;
while(cin>>a>>b>>c>>d>>e>>f){
x=(c-f*b/e)/(a-d*b/e)+0.0005;
y=(c-a*x)/b+0.0005;
x-=x%0.001;
y-=y%0.001;
cout<<x<<" "<<y<<endl;}}

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

int main()
{ 
	double x1, x2, y1, y2, z1, z2;
	double x, y;
	while (cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2) {//係数値を入力している。
		double tmp = x1;
		x1 *= x2; y1 *= x2; z1 *= x2;//xの係数で連立する。
		x2 *= tmp; y2 *= tmp; z2 *= tmp;
		y = (z1 - z2) / (y1 - y2);//ｙを計算する。
		if (z1 - z2 == 0)y = 0;//-0.000にならないようにしている。
		x = (z1 - (y1*y)) / x1;//xの計算
		if (z1 - (y1*y) == 0)x = 0;//-0.000にならないようにしている。
		int a, b;
		a = x * 10000;//小数第4桁の四捨五入
		if (a % 10 > 4) {
			a += 10;
			x = double(a) / 10000;
		}
		b = y * 10000;//小数第4桁の四捨五入
		if (b % 10 > 4) {
			b += 10;
			y = double(b) / 10000;
		}
		cout << fixed;//小数第4桁までを出力したい
		cout << setprecision(3) << x << ' ' << y << endl;

	}
	return 0;
}

C++: /**********************************************************
Status:
Problem:
Author:     Md. Shahidul Islam,
            Department of Computer Sciemce and Engineering,
            Begum Rokeya University, Rangpur, Bangladesh
Created on:
***********************************************************/

#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define vi vector<int>
#define ll long long
#define eps 1e-6
int main()
{
    //freopen("d.txt", "r", stdin);
    int a,  b, c, d, e, f;
    double x, y;
    while(scanf("%d %d %d", &a, &b, &c)!=EOF)
    {
        scanf("%d %d %d", &d, &e, &f);
        
        y=(double)((c*d-a*f)/(b*d-a*e));
        x=(double)((c-b*y)/a);
        printf("%.3lf %.3lf\n", x, y);
    }
    return 0;
}
/**********************************************************
About this problem:

************************************************************/

C++: #include<bits/stdc++.h>
using namespace std;
 main(){
  int a,b,c,d,e,f,r,lcm;
  int n,m;
  int x,y,num,sum;

  while(cin>>a>>b>>c>>d>>e>>f){

    if(a>d){
      m=a;
      n=d;
      if(a<0){
	m*=-1;
      }
      if(d<0){
	n*=-1;
      }
    }
    else{
      m=d;
      n=a;
      if(a<0){
	n*=-1;
      }
      if(d<0){
	m*=-1;
      }
    }

    r=m%n;
    while( r != 0 ){
      m=n;
      n=r;
      r=m%n;
    }
    lcm=a*d/n;

    num=lcm/a;
    sum=lcm/d;

    a*=num;
    b*=num;
    c*=num;

    d*=sum;
    e*=sum;
    f*=sum;

    if( a-d == 0 ){
      y=(c-f)/(b-e);
    }
    else if( a+b == 0 ){
      y=(c+f)/(b+e);
    }

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

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

  }
  return(0);
}

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

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

	while (cin >> a >> b >> c >> d >> e >> f){

		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 <cstdio>
using namespace std;
int main(){
	float a,b,c,d,e,f;
	float g,h,i,j,k,l,n,m,o,p,q,r;
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
		g=a/d;
		a*=g*-1;
		b*=g*-1;
		c*=g*-1;
		h=b+e;
		i=c+f;
		j=i/h;
		k=e*j;
		l=f-k;
		n=l/d;
		cout<<n<<" "<<j<<endl;
	}
	return 0;
}

C++: #include<stdio.h>

int main(){
  int a, b, c, d, e, f;
  while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
    double ans1 = (double)(e*c-b*f)/(double)(a*e-b*d);
    double ans2 = (double)(-d*c+a*f)/(double)(a*e-b*d);
    if (ans1 == 0) ans1 = 0;
    if (ans2 == 0) ans2 = 0;
    printf("%.3lf %.3lf\n", ans1, ans2);
  }
  return 0;
}

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

/*
ax + by = c
dx + ey = f

x = (c-by)/a
d(c-by)/a + ey = f
dc/a - dby/a + ey = f
ey - dby/a = f - dc/a
y(e-db/a) = f - dc/a
y = (f-dc/a)/(e-db/a)

aex + bey = ce
bdx + bey = bf
aex - bdx = ce - bf
x(ae - bd) = ce - bf
x = (ce - bf)/(ae - bd)
by = c - ax
y = (c - ax)/b
*/
int main()
{
    while(true){
        double a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if(std::cin.eof()) break;
        // double y = (f-d*c/a)/(e-d*b/a);
        // double x = (c-b*y)/a;
        double x = (c*e - b*f) / (a*e - b*d);
        double y = (c - a*x) / b;
        std::cout << std::fixed << std::setprecision(3);
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}

C++: #include<stdio.h>
#define rep(i,m,n) for(i = m;i < n;i++)
int main(){
	int a[6],i;
	int kcor = 0;
	double kx[1000] = {0},ky[1000] = {0};
	while(scanf("%d",a)!=-1){
		rep(i,1,6)
			scanf("%d",a+i);
		int det;
		det = a[0]*a[4]-a[1]*a[3];
		kx[kcor] = (a[4]*a[2]-a[1]*a[5])/det;
		ky[kcor] = (-a[3]*a[2]+a[0]*a[5])/det;
		kcor++;
	}
	rep(i,0,kcor)
		printf("%.3lf %.3lf\n",kx[i],ky[i]);
	return 0;
}

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

using namespace std;

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

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>

int main(){
	double a, b, c, d, e, f;
	scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);
	printf("%.3f %.3f", ((c - b * (c * d - a * f) / (b * d - a * e)) / a, (c * d - a * f) / (b * d - a * e)));
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	int count = 0;
	vector<double> result_x,result_y;

	while(cin >> a >> b >> c >> d >> e >> f) {
		y = (a * f - c * d) / (a * e - b * d);
		if(a==0)
			x = (c - b * y) / a;
		else
			x = (f - e*y) / d;
		result_y.push_back(y);
		result_x.push_back(x);
		printf("%.3f %.3f\n", x,y);
		count++;
	}

	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 = (c * d - f * a) / (b * d - a * e);
        double x = (f - e * y) / d;

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