Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	long double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		c *= (d / a);
		b *= (d / a);
		a *= (d / a);
		long double ansx=0, ansy=0;
		if (f - c != 0) {
			ansy = (f - c) / (e - b);
		}
		if (a != 0) {
			ansx = (c - ansy*b) / a;
		}
		ansx *= 1000;
		ansx = round(ansx);
		ansx /= 1000;
		ansy *= 1000;
		ansy = round(ansy);
		ansy /= 1000;
		if (ansx == 0) ansx = 0;
		if (ansy == 0) ansy = 0;
		printf("%.3LF %.3LF\n", ansx, ansy);
	}
}

C++: #include <iostream>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if ( cin.eof() )
			break;

		double delta = 1.0 / ( a*e - b*d );

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

		cout.setf( ios::showpoint );
		cout.precision( 4 );
		cout << x << " " << y << endl;

	}
}

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




double gcd( double m, double n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

double lcm( double m, double n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}


int main(){
    
	double ax, by, c, dx, ey, f;
    double x, y;
    double l, d1, d2;
        
	while(cin>> ax>> by>> c >> dx>> ey>> f){
        
        x = 0.0;
        y = 0.0;
        
        if(ax == dx){
            by -= ey;
            y = (c-f) / by;
            x = (f + ey*(-y)) / dx;
        }
        else if (by == ey) {
            ax -= dx;
            x = (c-f) / ax;
            y = (f + dx*(-x)) / ey;
        }
        else{
            l = lcm(fabs(ax), fabs(dx));
            d1 = l / ax;
            d2 = l / dx;
            ax *= d1;
            by *= d1;
            c  *= d1;
            dx *= d2;
            ey *= d2;
            f  *= d2;
            
            by -= ey;
            y = (c-f) / by;
            x = (f + ey*(-y)) / dx;
        }
        
        printf("%.3lf %.3lf\n", x, y);
        
        
	}
    
    
	return 0;
}

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

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

using namespace std;

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

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

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

	cout >> fixed >> setprecision(3) >> x >> " " >> y >> endl;
	//printf("%.3f %.3f\n", x, y);
}

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

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

C++: #include <stdio.h>

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

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

double r(double d){
  roundl(d*1000)/1000;
}

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double a,b,c,d,e,f,a2,b2,c2,d2,e2,f2,e3; // ax+by=c  dx+ey=f
  while(cin >> a >> b >> c >> d >> e >> f){
    a2=a;
    b2=b;
    c2=c;

    a/=b;
    c/=b;
    a*=(-1);
    c*=e;
    a*=e;
    a+=d;
    f-=c;
    double ansx=f/a;
    printf("%.3f ",ansx);
 
    a2*=ansx;
    c2-=a2;
    double ansy=c2/b2;
    printf("%.3f\n",ansy);
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
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 = c - b * (y / a);
		printf("%.3lf %.3lf\n", x, y);
	}
	//printf("%.3lf\n", a + b);
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		cout<<(e*c-b*f)/(a*e-b*d)<<" "<<(a*f - c*d) / (a*e - b*d) << endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	double D;
	
	while ( (cin >> a) && (cin >> b) && (cin >> c) && (cin >> d) && (cin >> e) && (cin >> f) ) {
		D = a*e - b*d;
		x = (e*c - b*f) / D;  x+=0;
		y = (-d*c + a*f) / D; y+=0;

		cout << fixed << setprecision(3);
		cout << x << " " << y << endl;
	}
	
	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 A = a*e-b*d;
    double ans1, ans2;
    ans1 = (c*e - b*f)/A;
    ans2 = (-c*d + a*f)/A;
    if(ans1<0.0005 && ans1> -0.0005) ans1 = 0;
    if(ans2<0.0005 && ans2> -0.0005) ans2 = 0;

    printf("%1.3f %1.3f\n",ans1,ans2);
    }
    return 0;
}

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


using namespace std;

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#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=(a*f-c*d)/(a*e-b*d);
    y=(c*e-f*b)/(a*e-b*d);
    printf("%.3lf %.3lf \n",y,x);
  }
}

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

int a, b, c, d, e, f;
double x, y;

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

	return 0;
}

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

int main() {
	int a, b, c, d, e, f;
	int cnt = 0;
	std::vector<double> x_vector;
	std::vector<double> y_vector;

	while (cin >> a >> b >> c >> d >> e >> f) {
	//???????????°
	/*
	while (!cnt) {
		cnt++;
		cin >> a >> b >> c >> d >> e >> f;
	*/
	//end ??????????????°
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < x_vector.size(); i++) {
		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::setprecision(3) << y_vector[i] << endl;
	}

	//???????????°
	//while (1);

	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;
    if(x == -0) x = 0;
    if(y == -0) y = 0;
    printf("%.3lf %.3lf\n", x, y);
  }

  return 0;
}