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)
		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>
int gcd(int x,int y){
	if(y==0)return x;
	else return gcd(y,x%y);
}
int main(){
	while(1){
		double a,b,c,d,e,f;
		std::cin>>a>>b>>c>>d>>e>>f;
		double b2=b*gcd(a,d)/a;
		double e2=e*gcd(a,d)/d;
		double c2=c*gcd(a,d)/a;
		double f2=f*gcd(a,d)/d;
		double y=(f2-c2)/(e2-b2);
		double x=(e-b*y)/a;
		std::cout<<x<<" "<<y<<std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){

    double a,b,c,d,e,f;
    
    while(cin>>a){
        cin>>b>>c>>d>>e>>f;
        double h=a*e-b*d;
        double xx=(c*e-f*b);
        double yy=(a*f-c*d);
        
        //double ue=a*c+b*f;
        //double st=d*c+e*f;
        
        double x=xx/h;
        double y=yy/h;
        printf("%.3f %.3f \n",x,y);
       
    }
return 0;
}

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

using namespace std;

// a = 1のとき
// x = c - by
// d(c-by)*ey=f
// y = (f - dc) / (e - db)

double func1(double y1, double r1, double x2, double y2, double r2) {
	double temp1 = x2 * y1;
	double temp2 = x2 * r1;
	return (r2 - temp2) / (y2 - temp1);
}

int main() {

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

	double x = 0.0, y = 0.0;

	// double型は等価比較してはいけないといわれるが、
	// 一度も計算していないためこのケースは問題なし
	if (a == 1.0) {
		y = func1(b, c, d, e, f);
		x = c - b * y;
	}
	else if (d == 1.0) {
		y = func1(e, f, a, b, c);
		x = f - e * y;
	}
	else if (b == 1.0) {
		x = func1(a, c, e, d, f);
		y = c - a * x;
	}
	else if (e == 1.0) {
		x = func1(d, f, b, a, c);
		y = f - d * x;
	}
	else {
		// aが1となるように計算
		double a_1 = 1.0, b_1 = b / a, c_1 = c / a;
		y = func1(b_1, c_1, d, e, f);
		x = c_1 - b_1 * y;
	}

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

	return 0;
}

C++: #include <stdio.h>

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

	while(1){
		if(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != 6){
			break;
		}

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

		if(x == 0){
			x = 0;
		}
		if(y == 0){
			y = 0;
		}

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

	return 0;
}

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

    while (scanf ("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)==6)
    {
        y=(f*a-d*c)/((a*e-b*d)*1.0);
        x=(c-b*y)/a;

        printf ("%0.3lf %0.3lf\n",x,y);
    }
}

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

	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) {
		b /= a;
		c /= a;
		e /= d;
		f /= d;
		y = (c - f) / (b - e);
		x = f - e * y;
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

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

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

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

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

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

int main(int argc, char const* argv[])
{
	double a, b, c, d, e, f;
	const unsigned precision{3};
	std::cout << std::fixed << std::setprecision(precision);

	std::cin >> a >> b >> c >> d >> e >> f;
	while (!std::cin.eof()) {
		auto x = ( e*c - b*f )/( e*a - d*b );
		auto y = ( d*c - a*f )/( d*b - e*a );
		x = (std::abs(x) < 0.5 / std::pow(10,precision)) ? 0.0 : x;
		y = (std::abs(y) < 0.5 / std::pow(10,precision)) ? 0.0 : y;
		std::cout << x << ' ' << y << std::endl;
		std::cin >> a >> b >> c >> d >> e >> f;
	}
	return 0;
}

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

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

int main(void){
	//cin>>a>>b>>c>>d>>e>>f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x,y;
		/*
		ax+by=c;
		dx+ey=f;
		ax=c-by;
		x=(c-by)/a;
		d(c-by)/a+ey=f;
		dc/a-dby/a+ey=f;
		-dby/a+ey=f-dc/a;
		(e-db/a)y=f-dc/a;
		y=(f-dc/a)/(e-db/a);
		y=(fa-dc)/(ae-db)
		x=(c-by)/a;
		*/
		y=(f*a-d*c)/(a*e-d*b);
		x=(c-b*y)/a;
		cout<<fixed<<setprecision(3);
		cout<<x<<" "<<y<<endl;
	}
		//cin>>a;
}

C++: #include<iostream>

using namespace std;

int main()
{
	while(1){
		int a[6];
		double detA;
		double ansx, ansy;
		
		for(int i = 0; i < 6; i++){
			cin >> a[i];
			if(a[i] == EOF){
				exit(0);
			}
		}
		
		detA = ((a[0]*a[4])-(a[1]*a[3]));
		
		ansx = ((a[2]*a[4])-(a[1]*a[5]))/detA;
		ansy = ((a[0]*a[5])-(a[2]*a[3]))/detA;
		
		if(ansx == 0){
			ansx = 0;
		}
		if(ansy == 0){
			ansy = 0;
		}
		
		printf("%.4lf %.4lf\n",ansx,ansy);
	}
}

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

int main() {
	int a, b, c, d, e, f; double xNum, xDen, yNum, yDen;
	while (cin >> a >> b >> c >> d >> e >> f) {
		xNum = c * e - b * f; xDen = a * e - b * d;
		yNum = a * f - c * d; yDen = a * e - b * d;
		cout << fixed << setprecision(3)
			<< xNum / xDen + 1e-9 << " " << yNum / yDen + 1e-9 << endl;
	}
	return 0;
}

C++: #include <stdio.h>
int main(void){
    float a,b,c,d,s,t;
    while(~scanf("%f%f%f%f%f%f",&a,&b,&s,&c,&d,&t)){
        printf("%f %f\n",s*d-b*t/a*d-b*c,a*t-s*c/a*d-b*c);
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<algorithm>
#include<string>
#include<cctype>
#include<vector>
#include<queue>
#include<map>
using namespace std;

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

	while (cin >> a >> b >> c >> d >> e >> f) {
		//a*d-b*c=0:?§£??????
		G = 1 / (a*e - b*d);
		x = G*(e*c + (-b)*f);
		y = G*((-d)*c + a*f);
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}

	return 0;
}

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;    
 }