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;

double trunc(double d) {
    d *= 1000;

    if (d < 0) {
        d -= 0.5;
    } else {
        d += 0.5;
    }

    return d / 1000;
}

int main() {

    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double x = (b * f - c * e) / (b * d - a * e);
        double y = (d * c - a * f) / (b * d - a * e);

        if (x == -0.000) x = 0.0;
        if (y == -0.000) y = 0.0;

        cout << fixed << setprecision(3) << x << " " << y << 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);
    while(true){
        for(int i=0;i<2;i++){
            if(scanf("%lf%lf%lf",&A[i][0],&A[i][1],&b[i])==EOF)return 0;
        }

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

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

int main(){
	while(true){
		double a,b,c,d,e,f;
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.fail()) break;
		cout<<fixed<<setprecision(3)<<(c*e-b*f)/(a*e-b*d)<<" "<<(c*d-a*f)/(b*d-a*e)<<endl;
	}
	return 0;
}

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

int main() {
  for(int i = 0; i < 31; i++){
    int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
    double x, y;
    cin >> a >> b >> c >> d >> e >> f;


      if(a == 0 && b == 0 && c == 0 && d == 0 && e == 0 && f == 0){
        break;
      }
      else{
        d * a * x + d * b * y - a * d * x - a * e * y == d * c - a * f;
        (d * b - a * e) * y == d * c - a * f;
        y = (d * c - a * f) / (d * b - a * e);
        double Y = round(y * 1000);
        y = Y / 1000;
        x = (c - b * y) / a;
        double X = round(x * 1000);
        x = X / 1000;
        cout << fixed;
        cout << setprecision(3) << x << " " << setprecision(3) << y << endl;
      }
  }

}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(){

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

    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	double a[60000]={0};
	int i=0;
	while(cin>>a[i++]);
	int n=i-1;
	for(int j=0;j<n;j+=6){
		double k=a[j]/a[j+3],x=0,y=0;
		a[j+3]*=k,a[j+4]*=k,a[j+5]*=k;
		y=(a[j+2]-a[j+5])/(a[j+1]-a[j+4]);
		x=(a[j+2]-a[j+1]*y)/a[j];
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

C++: #include <iostream>

using namespace std;

#define EPS 1e-9

int main()
{
	int a,b,c,d,e,f;
	float x,y,dx,dy;
	while( cin >> a >> b >>c >>d >> e >> f ) {
		x = (c*e-b*f)/(float)(a*e-b*d);
		y = (c - a*x)/(float)b;
		

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



	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)
	{
		printf("%.3f ",(c*e-b*f)/(a*e-b*d)+0.0005);
		printf("%.3f\n",(d*c-a*f)/(b*d-a*e)+0.0005);
	}
}

//大文字を小文字に変換
/*
for(int i=0;i<inp.size();i++)
			if(inp[i]>='A' && inp[i]<='Z')
				inp[i]+='a'-'A';
*/

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

using namespace std;

int main(){
  for(double a,b,c,d,e,f;cin>>a>>b>>c>>d>>e>>f;){
    double x=(c*e-f*b)/(a*e-d*b);
    double y=(f-d*x)/e;
    if(fabs(x)<1e-9){
      x=0;
    }
    if(fabs(y)<1e-9){
      y=0;
    }
    cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl;
  }
  return 0;
}

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

using namespace std;

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

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

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

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

int main(void) {
    int a, b, c, d, e, f;
    float x, y;
    float det;
    while(cin >> a >> b >> c >> d >> e >> f) {
        det = a * e - b * d;
        x = (float)(e * c - b * f) / det;
        y = (float)(-d * c + a * f) / det;
        x = roundf(1000 * x) / 1000.0;
        y = roundf(1000 * y) / 1000.0;
        if(x == -0)
            x = 0.0;
        if(y == -0)
            y = 0.0;
        printf("%f %f\n", x, y);
    }
}

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

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

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

C++: #include <iostream>
#include <stdio.h>
#include <cmath>
#define EPS 1e-10
using namespace std;
int main(){
  double a,b,c,d,e,f;

  while(1){
    cin >> a >> b >> c >> d >> e >> f;
    if(cin.eof())break;

    double x = (f*b-c*e)/(b*d-a*e);
    double y = (c - a*x)/b;
    if(abs(x) < EPS)x = 0;
    if(abs(y) < EPS)y = 0;
    printf("%.3f %.3f\n",x,y);
  }
}