Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

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

using namespace std;

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

	while(cin >> a >> b >> c >> d >> e >> f){
			delta = (a * e) - (b * d);

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

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

	return 0;
}

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

template <typename T> double round(const T r, const int n = 0){
    if(r>=0){
        return floor(r * pow(10, -n) + 0.5) * pow(10, n);
    }
    else{
        return ceil(r * pow(10, -n) - 0.5) * pow(10, n);
    }
}

int main(){
    double a, b, c, d, e, f;
	while(std::cin >> a){
		std::cin >> b >> c >> d >> e >> f;
		std::cout << std::fixed << std::setprecision(3)
			<< round((c * e - b * f) / (a * e - b * d), -3) << ' '
			<< round((a * f - c * d) / (a * e - b * d), -3) << std::endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int b,a,e,d,f,i,c;
	float y,x;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)  {
			y=(c*d-a*f)/(b*d-a*e);
			x=(c-(b*y))/a;
		if(x==-0.0000){
			x=0.0000;
		}
		if(y==-0.000){
			y=0.0000;
		}	
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		
		if (x<0.0005 && x>-0.0005){
			x=0;
		}
		if (y<0.0005 && y>-0.0005){
			y=0;
		}
	//	printf("%.3f %.3f\n",x,y);
	//	printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
	//	printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(){
	double matrix[4],ans[2];
	while(scanf("%lf %lf %lf %lf %lf %lf",&matrix[0],&matrix[1],&ans[0],&matrix[2],&matrix[3],&ans[1]) != EOF){
		double t = matrix[0]*matrix[3]-matrix[1]*matrix[2];
		printf("%.3lf %.3lf\n",matrix[3]*ans[0]/t-matrix[1]*ans[1]/t,-matrix[2]*ans[0]/t+matrix[0]*ans[1]/t);
	}
	return 0;
}

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

using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		X=(double)(C*E-F*B)/(A*E-D*B);
		Y=(double)(A*F-D*C)/(A*E-D*B);

		printf("%.3f %.3f\n",X,Y);
	}
	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)){
        double y=(double)(c*d-a*f)/(double)(b*d-a*e);
        if(a!=0)
        printf("%.3f %.3f\n",(c-b*y)/a,y);
        else
        printf("%.3f %.3f\n",(f-e*y)/d,y);
    }
}

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

void solve_SE(double* x, double a, double b, double c, double d, double e, double f)
{
    x[0] = (c * e - f * b) / (a * e - d * b);
    x[1] = (c * d - f * a) / (b * d - e * a);
}

int main()
{
    double a, b, c, d, e, f;
    double x[2];
    while (cin >> a >> b >> c >> d >> e >> f) {
        solve_SE(&x[0], a, b, c, d, e, f);
        cout << x[0] << ' ' << x[1] << endl;
    }
}

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

int main(){
    	int a, b, c, d, e, f;
	double x, y;
	while(1){
	if (!(cin>>a>>b>>c>>d>>e>>f))break;
		x=(double)(1.0/(a*e-b*d))*(e*c-b*f);
		y=(double)(1.0/(a*e-b*d))*(-d*c+a*f);
		cout << (double)x << " " << (double)y << endl;
	}
	return 0;
}

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

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

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

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

bool get_input()
{
	return (std::cin >> a >> b >> c >> d >> e >> f);
}

void solve()
{
	double det = a * e - b * d;
	double x, y;

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

	if (x == 0) x = 0.000;
	if (y == 0) y = 0.000;

	std::cout.setf(std::ios::fixed, std::ios::floatfield);
	std::cout.precision(3);
	std::cout << x << ' ' << y << std::endl;
}


int main()
{
	while (get_input()) {
		solve();
	}
	return 0;
}

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double m[2][2],det,inv[2][2],ans[2],x,y;
  while(cin >>m[0][0]>>m[1][0]>>ans[0]>>m[0][1]>>m[1][1]>>ans[1]){
    det = m[0][0]*m[1][1]-m[1][0]*m[0][1];
    inv[0][0] = m[1][1]/det;
    inv[0][1] = -m[0][1]/det;
    inv[1][0] = -m[1][0]/det;
    inv[1][1] = m[0][0]/det;
    x = inv[0][0]*ans[0]+inv[1][0]*ans[1];
    y = inv[0][1]*ans[0]+inv[1][1]*ans[1];
    printf("%.3lf %.3lf\n",x,y);
  }
  return 0;
}

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

C++: #include<cstdio>
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	double x[500];
	double y[500];
	double a, b, c, d, e, f;
	int i = 0;
	do
	{
		cin >> a >> b >> c >> d >> e >> f;
		double sum_d = (a*e - b * d);
		y[i] = (a*f - c * d) / sum_d;
		x[i] = (c * e - b * f) / sum_d;
		++i;
	} while (cin.get() != EOF);
	--i;
	int j = 0;
	for (; j <= i; ++j)
	{
		if ((x[j] - 0) < 0.0001 && (x[j] - 0) > -0.0001)
		{
			x[j] = 0;
		}
		else if ((y[j] - 0) < 0.0001&& (y[j] - 0) > -0.0001)
		{
			y[j] = 0;
		}
		cout<< fixed << setprecision(3) << x[j] << " " << y[j]<<endl;
	}
}

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

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

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

C++: #include <stdio.h>

double dc4pi5(double arg,int n){
	int i = 0;
	for(i = 0;i < n;i++){
		arg *= 10;
	}
	int tmp = (int)arg;
	double ret = tmp;
	if(tmp % 10 <= 4){
		ret -= tmp % 10;
	}else{
		ret += 10 - tmp % 10;
	}
	for(i = 0;i < n;i++){
		ret /= 10;
	}
	return ret;
}

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