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("%04f %04f\n", x, y)
        }
}

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;

  while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF){
    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>
int main(void)
{
  float a,b,c,d,e,f,x,y;
  while(scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f) != EOF){
  	x=(c*e-b*f)/(a*e-b*d);
  	y=(c*d-a*f)/(b*d-a*e);
	if(x>=0){
		x+=0.0004;
	}
	else{
		x-=0.0004;
	}
	if(y>=0){
		y+=0.0004;
	}
	else{
		y-=0.0004;
	}
	printf("%.3f %.3f\n",x,y);
  }
  return(0);
}

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

int main() {
	int cnt = 0;
	int a[200], b[200], c[200], d[200], e[200], f[200];
	double x[200], y[200];

	while(cin >> a[cnt] >> b[cnt] >> c[cnt] >> d[cnt] >> e[cnt] >> f[cnt]) cnt++;

	for(int i=0; i<cnt; i++) {
		if(a[i] != 0 && b[i] != 0 && d[i] != 0 && e[i] != 0) {
			x[i] = (b[i]*f[i]-e[i]*c[i])/(b[i]*d[i]-a[i]*e[i]);
			y[i] = (d[i]*c[i]-a[i]*f[i])/(b[i]*d[i]-a[i]*e[i]);
		} else {
			if(a[i] == 0) {
				y[i] = c[i]/b[i];
				x[i] = (f[i]-e[i]*y[i])/d[i];
			} else if(b[i] == 0) {
				x[i] = c[i]/a[i];
				y[i] = (f[i]-d[i]*x[i])/e[i];
			} else if(d[i] == 0) {
				y[i] = f[i]/e[i];
				x[i] = (c[i]-b[i]*y[i])/a[i];
			} else if(e[i] == 0) {
				x[i] = f[i]/d[i];
				y[i] = (c[i]-a[i]*x[i])/b[i];
			}
		}
	}

	for(int i=0; i<cnt; i++) cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl;

	return 0;
}

C++: import numpy
#while True:
#   try:
#       a,b,c,d,e,f = (int(i) for i in input().split())
#        x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]]
#        print("{0:.3f} {1:.3f}".format(x,y))
#   except EOFError:
#       break

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

int main(){
	double a, b, c, d, e, f;
	cout << setprecision(3) << setiosflags(ios::fixed);

	while(cin >> a >> b >> c >> d >> e >> f){
		cout << (c*e-b*f)/(a*e-b*d)+0.00001 << " " << (c*d-a*f)/(b*d-a*e)+0.0001 << endl;
	}

	return 0;

}

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