Go: package main

import (
  "fmt"
)

func main() {
  var a,b,c,d,e,f float64
  var x,y float64
  for _, err := fmt.Scan(&a, &b, &c, &d, &e, &f); err == nil;
   _, err = fmt.Scan(&a, &b, &c, &d, &e, &f) {
    y = (a*f-c*d)/(a*e-b*d)
    x = (c-b*y)/a
    fmt.Printf("%.3f %.3f\n", x,y)
  }
}

C++: 
/* vo05_04.cpp */
#include <iostream>
#include <cstdio>
using namespace std;

double m_round(double d);

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

	while (true) {

		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()) break;

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

		x = m_round(x); y = m_round(y);

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

	return 0;
}

double m_round(double d)
{
	if (d == 0) { d = 0; return d; }

	bool flag = false;
	if (d < 0) { flag = true; d = -d; }

	d *= 1000;
	d += 0.5;

	int t1 = (int)d;
	double t2 = d - (double)t1;
	d -= t2;

	d /= 1000;

	if (flag) { d = -d; }

	return d;
}

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

int main() {

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

    while ( cin >> a >> b >> c >> d >> e >> f ) {
        double det = a * e - b * d;
        double x = (c * e - b * f) / det + 0.0;
        double y = (a * f - c * d) / det + 0.0;
        printf("%.3f %.3f", x, y);
        cout << endl;
    }

    return 0;
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>

using namespace std;

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

C++: #include <cstdio>
#include <stdlib.h>
#include <math.h>

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

double round( double val, int precision )
{
    double    ret;
    char    buf[256] = {'\0'};
    char    *p;

    sprintf( buf, "%.*f", precision, val );
    ret = strtod( buf, &p );

    return ret;
}

int main (){
 while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
 if (a == EOF)	
		break;			

  x=(f*b/e-c)/(d*b/e-a);
  y=(f*a/d-c)/(e*a/d-b);
 round(x,4);
 round(y,4);
if(x/1000== -0.000) x=0.000;
if(y/1000== -0.000) y=0.000;
  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;
	cout << setprecision(3);
	cout << fixed;
	while (cin >> a >> b >> c >> d >> e >> f){
		double x = (c * e - b * f) / (a * e - b * d);
		double y = (c * d - a * f) / (b * d - a * e);
		cout << x << " " << y << endl;
	}
	return 0;
}

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

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

}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
   int a,b,p,c,d,q;
   float x,y;
   while(cin >> a >> b >> c >> d >> e >> f)
   {
      x=(float)(d*p-b*q) / (a*d - b*c);
      y=(float)(a*q-c*p) / (a*d - b*c);
      x *= 1000;
      x +=0,5;
      x = (int)x;
      x /= 1000;
      y *= 1000;
      y +=0,5;
      y = (int)x;
      y /= 1000;
      printf("%.3f %.3f\n" ,x,y);
   }
    return 0;
}

C++: #include <iostream>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

string float_to_string(float f, int digits)
{
  if (f == 0) {
    f = 0;
  }
  ostringstream oss;
  oss << setprecision(digits) << setiosflags(ios::fixed) << f;
  return oss.str();
}

void calc_and_output(int *c)
{
  float x = (float)(c[1]*c[5]-c[2]*c[4])/(c[1]*c[3]-c[0]*c[4]);
  float y = (float)(c[0]*c[5]-c[2]*c[3])/(c[0]*c[4]-c[1]*c[3]);

  cout << float_to_string(x, 3) << " " << float_to_string(y, 3) << endl;
}

int main(int argc, char const* argv[])
{
  int c[6];

  string line;
  while (getline(cin, line)) {
    istringstream iss(line);
    int val;
    int c[6];
    for (int i = 0; i < 6; i++) {
      iss >> val;
      c[i] = val;
    };

    calc_and_output(c);
  }

  return 0;
}

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

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

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

using namespace std;


int main(int argc, const char * argv[]) {
    // insert code here...
    
    int a,b,c,d,e,f;
    double x, y;
    
    cin >> a >> b >> c >> d >> e >> f;
    
    y = (f-c*(d/a)) / (e-b*(d/a));
    x = (c-b*y)/a;
    
    cout << setprecision(3) << x << endl;
    cout << setprecision(3) << y << endl;
    return 0;
}

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

bool sisya(double x)
{
	if(x < 0)
		x = -x;
			x = x*1000;
	x = x - static_cast<double>(static_cast<int>(x));
	x = x+0.5;
	if(x >= 1.0){
		return true;
	}
	return false;
}

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	while (cin >> a && cin >> b && cin >> c && cin >> d && cin >> e && cin >> f){
		x = (f/e - c/b) / (d/e - a/b) ;
		if(sisya(x))
			x += 0.001;
		y = (f/d - c/a) / (e/d - b/a) ;
		if(sisya(y))
			y += 0.001;
		cout << setprecision(3) << fixed << x << endl;
		cout << setprecision(3) << fixed << y << endl;
	}
	return 0;
}

C++: #include <iostream> 
#include <cstdio>
using namespace std;
const int n = 10000100;
double a[n], b[n], c[n], d[n], e[n], f[n], x[n], y[n]; 
int main () {
	int count = 1;
	while (cin >> a[count] >> b[count] >> c[count] >> d[count] >> e[count] >> f[count]) count++;

	for (int i = 1; i < count; i++) {
		x[i] = (c[i] * e[i] - b[i] * f[i]) / (a[i] * e[i] - b[i] * d[i]);
		y[i] = (a[i] * f[i] - c[i] * d[i]) / (a[i] * e[i] - b[i] * d[i]);
		x[i] = (int)(1000 * x[i] + 0.5) / 1000;
		y[i] = (int)(1000 * y[i] + 0.5) / 1000;
		printf ("%.3f %.3f\n", x[i], y[i]);
	}
	
	return 0;
}

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

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

 	return 0;
}

C++: #include <bits/stdc++.h>
#define EPS 1e-8
using namespace std;
typedef vector <double> vec;
typedef vector <vec> mat;

vec gauss(const mat& A,const vec&b){
  int n=A.size();
  mat B(n,vec(n+1));
  
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++) B[i][j]=A[i][j];

  for(int i=0;i<n;i++)B[i][n]=b[i];

  for(int i=0;i<n;i++){
    int pivot=i;
    for(int j=i;j<n;j++){
      if(abs(B[j][i])>abs(B[pivot][i]))pivot=j;
    }
    swap(B[i],B[pivot]);
    if(abs(B[i][i])<EPS)return vec();
    
    for(int j=i+1;j<=n;j++) B[i][j]/=B[i][i];
    for(int j=0;j<n;j++){
      if(i!=j){
	for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];
      }
    }
  }
    vec x(n);
    for(int i=0;i<n;i++) x[i]=B[i][n];
    return x;
}



int main(){
  while(1){
    mat A(2,vec(2));
    vec b(2);
    if(!(cin>>A[0][0]))break;
    cin>>A[0][1]>>b[0];
    cin>>A[1][0]>>A[1][1]>>b[1];
    vec ans=gauss(A,b);
    printf("%.3f %.3f\n",ans[0],ans[1]);
  }
  return 0;
}