Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a, b, c, d, e, f float64
		i, _ := fmt.Scan(&a, &b, &c, &d, &e, &f)
		if i == 0 {
			break
		}

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

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

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

using namespace std;

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

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){
         
         double tmp1,tmp2;
        tmp1= (c*e - b*f)/ (a*e - b*d);
        tmp2 = (c*d - a*f)/(b*d - a*e);
        x = tmp1;
        y = tmp2;
            if(x == 0)x = 0;
            if(y == 0)y = 0;
         printf("%.3f %.3f",x,y);
        
    }
    return 0;
}

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

int main() {
        int a, b, c, d, e, f;
        double x, y;
        char line[200];

        while(fgets(line, 200, stdin) != NULL) {
                sscanf(line, "%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
                x = ((double)e*c - b*f) / (a*e - d*b);
                y = ((double)a*f - d*c) / (a*e - d*b);
                x = ((int)(x * 1000 + 0.5)) / 1000.0;
                y = ((int)(y * 1000 + 0.5)) / 1000.0;
                printf("%.3f %.3f\n", x, y);
        }
}

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

int main()
{
    int a1, b1, c1, a2, b2, c2, d, dx, dy;
    while(cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2){
        d = a1*b2 - a2*b1;
        dx = c1*b2 - c2*b1;
        dy = a1*c2 - a2*c1;
        if(d != 0){
            float x = (float)dx/d;
            float y = (float)dy/d;
            if (x == 0.0) x = abs(x);
            if (y == 0.0) y = abs(y);
            cout <<fixed << setprecision(3)<< x <<' '<< y <<endl;
        }
    }
    return 0;
}

C++: const int tt = 10000;

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

string toStr(int n);
string intToString(int n);

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

    int det = a * e - b * d;

    int x = ( e * c - b * f) / det;
    int y = (-d * c + a * f) / det;
//    cout << x << y << endl;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  string pm, val;
  
  if (n < 0) {
    pm = "-";
    n = -n;
  } else {
    pm = "";
  }

  int ipart = n / tt;
  int fpart = (n - ipart * tt) + tt + 5;

  val = pm + intToString(ipart) + "." + intToString(fpart).substr(1, 3);
  return val;
}

string intToString(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}

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 <cstdio>
using namespace std;

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

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

  while (cin >> a, cin >> b, cin >> c, cin >> d, cin >> e, cin >> f) {
    printf("%.4f %.4f\n", (c * e - f * b) / (a * e - d * b) + 0, (c * d - f * a) / (b * d - e * a) + 0);
  }

  return 0;
}

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

int main() {
	int a, b, c, d, e, f;
	std::vector<int> x_vector;
	std::vector<int> y_vector;
	
	while (cin >> a >> b >> c >> d >> e >> f) {
		int x = (b * (f - e * c)) / (b * d - a * e);
		int y = (c * d - a * f) / (b * d - a * e);

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

	for (int i = 0; i < x_vector.size(); i++) {
		cout << x_vector[i] << y_vector[i] << endl;
	}

	return 0;
}

C++: #include <stdio.h>

//#define DEBUGNOW
/*
#ifdef DEBUGNOW
#define debug
#else
*/
#define debug 1 ? (void)0 :
//#endif

double sishagonyu(double num)	{
	
	//int num2;
	
	if (num == 0) return num;
	
	if (num > 0) { num += 0.0005; }
	else { num -= 0.0005; }
	
	num = (double)(int)(num * 1000) / 1000;
	
	//	num *= 1000;
	//	num2 = (int)num;
	//	num = num2;
	//	num /= 1000;
	
	return num;
}

int main() {
	
	//printf("%.3lf", sishagonyu((double)-0.0015));
	
	
	double a, b, c, d, e, f;
	double x, y;
	
	double n, m, h, i;
	
	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		
		//if (scanf("%lf %lf %lf %lf %lf %f", &a, &b, &c, &d, &e, &f) == EOF) break;
		
		debug printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f);	//input
		
		if (a == 0) { y = c / b; }
		if (b == 0) { x = c / a; }
		if (d == 0) { y = f / e; }
		if (e == 0) { x = f / d; }
		
		n = a / d;
		
		//j = d * n;
		h = e * n;
		i = f * n;
		
		debug printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n);
		
		m = b - h;
		y = c - i;
		debug printf("%f %f\n", m, y);
		
		if(y <= 0.0004 && y >= -0.0005) { 
			
			debug printf("y = 0\n");
			y = 0; 
			
		} else {
			
			y /= m;
			debug printf("%f\n", y);
			
			i = c - (b * y);
			x = i / a;
			
			debug printf("x = %f, y = %f\n", x, y);
			
			x = sishagonyu(x);
			y = sishagonyu(y);
			
		}
		//printf("%f %f\n", x, y);
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}
//2.2 3.3 22.24706 3.2 8.7 50.12932
//3.2777 4.5564

//1 2 3 4 5 6
//-1.000 2.000

//2 -1 -2 -1 -1 -5
//1.000 4.000

//2 -1 -3 1 -1 -3
//0.000 3.000

// 2 -1 -3 -9 9 27
// 0.000 3.000

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

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


void setX() {
    double ae, bd, ce, bf;
    
    ae = a * e;
    bd = b * d;
    ce = c * e;
    bf = b * f;
    
    x = (double)((ce - bf) / (ae - bd));
    x *= sisya;
    if(x >= 0) x += 0.5;
    else x -= 0.5;
    x = int(x);
    x /= sisya;
}

void setY() {
    double ae, af, cd, bd;
    
    bd = b * d;
    ae = a * e;
    cd = c * d;
    af = a * f;
    
    y = (double)((cd - af) / (bd - ae));
    y *= sisya;
    if(y >= 0) y += 0.5;
    else y -= 0.5;
    y = int(y);
    y /= sisya;
    
}

int main(void) {    
    while(cin >> a >> b >> c >> d >> e >> f) {
        setX();
        setY();
        cout << setprecision(3);
        cout << setiosflags(ios::fixed);
        cout << x << " " << y << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	float a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		y = (d*c - a*f)/(d*b - a*e);
		x = (f - e*y)/d;
	
	printf("%0.3f %0.3f",x,y);
	}
}

C++: #include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    double a,b,c,d,e,f;
    while(cin >> a >>b >> c >> d >> e >> f){
    double det,x,y;
    det = a*e-b*d;
    x = (e*c-b*f)/det;
    y = (-c*d+a*f)/det;
    if (x==0)
        x = fabs(x);
    if (y==0)
        y = fabs(y);
    printf("%.3f %.3f\n",x,y);}
}