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 <iomanip>
using namespace std;
int main() {
    double a, b, c, d, e, f;
    while(cin >> a) {
        cin >> b >> c >> d >> e >> f;
        double x = (c * e - b * f) / (a * e - b * d);
        double y = (-c * d + a * f) / (a * e - b * d);
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }
    return 0;
}

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

int main(){
  int i = 0;
  while(1){
  i++;
  int a, b, c, d, e, f;
  scanf("%d ",&a);
  scanf("%d ",&b);
  scanf("%d ",&c);
  scanf("%d ",&d);
  scanf("%d ",&e);
  scanf("%d ",&f);
  
  double x, y;
  x = (double)(c*e-b*f) / (double)(a*e-b*d);
  y = (double)(a*f-c*d) / (double)(a*e-b*d);
  x = (double)round(x*10000.0) / 10000.0;
  y = (double)round(y*10000.0) / 10000.0;
  printf("%.3f %.3f\n", x, y);
  
  if(scanf("%d", &a)==EOF) break;
  else{
    int line = i * 6
    fseek(STDIN, lineL, SEEK_SET);
  }
  }
  
  return 0;
}

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

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

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

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

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

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

}

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

int main(){
  while(true){
    double a, b, c, d, e, f;
    std::cin >> a >> b >> c >> d >> e >> f;
    if(std::cin.eof()) return 0;

    double x, y;
    if(a==0){
      std::swap(a,d);
      std::swap(b,e);
      std::swap(c,f);
    }
    double s=d/a;
    d-=a*s; e-=b*s; f-=c*s;
    y=f/e;
    x=(-b*y+c)/a;

    std::cout << std::fixed;
    std::cout << std::setprecision(3) << x << " " << std::setprecision(3) << y << std::endl;
  }
}

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

void f1(float a,float b,float c,float d,float e,float f)
{
    float x,y;
    y=(c*d-a*f)*1.0/(b*d-a*e);
    x=(c-b*y)*1.0/a;
    cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
}

int main()
{
    float a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        f1(a,b,c,d,e,f);
    }
    return 0;
}

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

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

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

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

int main(){
	float a,b,c,d,e,f,x,y;
	while(scanf("%f",&a)){
	scanf("%f%f%f%f%f",&b,&c,&d,&e,&f);
	x=(c*e-b*f)/(a*e-b*d);
	y=(c*d-a*f)/(b*d-a*e);
	printf("%.3f %.3f",x,y);
	cout<<endl;
	}
	return 0;
	}

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

using namespace std;


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

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

    return 0;
}

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

C++: #include<iostream>
#include<stdio.h>
int main(){
	double a,b,c,d,e,f;
	double x,y;
	std::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);
	return 0;
}

C++: #include <iomanip>
#include <iostream>
 
using namespace std;
 
int main()
{ 
	ios::sync_with_stdio(0);
	cin.tie(0);

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

	while (cin >> a >> b >> c >> d >> e >> f)
	{
		// matrix
		double y = (d * c - a * f) / (d * b - a * e);
		double x = (c - b * y) / a;
		cout << setprecision(3) << fixed << x << " " << y << endl;
	}

	return 0;
}

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

#define MAX 256

int main(void){

	double a, b, c, d, e, f;
	double ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%f%f%f%f%f%f%f", &a,&b,&c,&d,&e,&f) != EOF){
		ansx[i] = (c*e - b*f) / (a*e - b*d);
		ansy[i] = (c*d - a*f) / (b*d - a*e);
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3f %.3f\n", ansx[j], ansy[j]);
	}

	return 0;
}

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


int main(void){

  int a;
  int b;
  int c;
  int d;
  int e;
  int f;

  float x;
  float y;

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

  x = a * e - b * d ;
  y = b * d - a * e ;

  if ((x == 0) && (y == 0)){
    cerr << "error" << endl;
    exit(1);
  }else if(x == 0){
    cerr << "error" << endl;
    exit(1);
  }else if(y == 0){
    cerr << "error" << endl;
    exit(1);
  }else{

    if(c * e - b * f == 0){
      x = 0;
    }else{
      x = ( c * e - b * f ) / x ;
    }

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

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

  return 0;


}

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a+10;
	a=double (int (a));
	a=a/10000;

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

C++: #include <cstdio>
#include <queue>
#include <vector>

using namespace std;


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

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

using namespace std;
double a,b,c,d,e,f;
double x,y;
double xMultiply, yMultiply;


int main()
{
    while(cin >> a >> b >> c >> d >> e >> f)
    {
        xMultiply = b;
        yMultiply = e;
        a = yMultiply * a;
        b = yMultiply * b;
        c = yMultiply * c;
        d = xMultiply * d;
        e = xMultiply * e;
        f = xMultiply * f;

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

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

        cout << fixed << setprecision(3) << x << " " << y;

    }
}