Go: package main

import "fmt"

func main() {

	for {
		var a, b, c, d, e, f float64
		var x, y float64
		i, _ := fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if i != 6 {
			return
		}

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

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

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

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

	while (cin >> a >> b >> c >> d >> e >> f) {
		x = (c / b - f / e) / (a / b - d / e);

		if (0 == x) { x *= -1; }
		y = (c - a * x) / b;

		cout << fixed << setprecision(3) << x << ' ' << y << endl;
	}
    return 0;
}

C++: #include <stdio.h>

int main(void) {
  double a, b, c, d, e, f;
  while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
    double ee = e / b, dd = d / a;
    double ax = a * ee, cx = c * ee;
    printf("%f ", (cx - f) / (ax - d) == -0 ? 0 : (cx - f) / (ax - d));
    b *= dd, c *= dd;
    printf("%f\n", (c - f) / (b - e) == -0 ? 0 : (c - f) / (b - e));
  }
  return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	double a, b, c;
	double d, e, f;
	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);
		
		if(x == -0)
			x = 0;
		if(y == -0)
			y = 0;
		
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

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

int main() {
	double a, b, c, d, e, f, x, y;
	while (cin >> a >> b >> c >> d >> e >> f) {
		// (1) a x + b y = c  && (2) dx +  ey =  f
		// (3) adx + bdy = cd && (4) adx + aey = af
		// (3) - (4) (bd - ae) * y = cd - af
		// (5) y = (cd - af) / (bd - ae)
		// (1) x = (c - by) / a
		y = (c * d - a * f) / (b * d - a * e);
		x = (c - b * y) / a;
		// 1.234ab * 1000
		// 1234.ab + 0.5
		// (int)(1234.cd / 1000)
		// 1.234c
		x *= pow(10, 3);
		y *= pow(10, 3);
		if (x < 0) {
			x -= 0.5;
		}
		else if (x > 0) {
			x += 0.5;
		}
		else {
			x;
		}
		if (y < 0) {
			y -= 0.5;
		}
		else if (y > 0) {
			y += 0.5;
		}
		else {
			y;
		}
		x = (int)x;
		y = (int)y;
		x /= pow(10, 3);
		y /= pow(10, 3);
		cout << fixed << setprecision(3) << x << flush;
		cout << " " << flush;
		cout << fixed << setprecision(3) << y << flush;
		cout << 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 x=(e*c-b*f)/(e*a-b*d);
        double y=(d*c-a*f)/(d*b-a*e);
    
        printf("%.3f %.3f\n",x+0.0,y+0.0);
    }
    
    return 0;
    
}

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

using namespace std;

int main() {

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

	while(cin >> a >> b >> c >> d >> e >> f) {
	
	 float y =(a*f - c*d)/(a*e - b*d);
	 float x =(c*e - b*f)/(a*e - b*d);

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

    return 0;
}

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

double round(double num);
/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	double a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 0
	while (cnt < 2) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

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

	for (unsigned int i = 0; i < cnt; i++) {
		double x_result = round(x_vector[i]);
		double y_result = round(y_vector[i]);

		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_result << " ";
		std::cout << std::setprecision(3) << y_result << endl;
	}

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

	return 0;
}

//?°???°????¬¬4???????????¨?????\????????¢??°
double round(double num) {
	int num_mul_10000 = num * 10000;
	int num_mul_1000  = num * 1000;
	if (5 <= (num_mul_10000 - num_mul_1000 * 10)) {
		return num + 0.001;
	}
	else {
		return num;
	}
}

C++: #include<bits/stdc++.h>
#include<cstdio>

using namespace std;

int main()
{

double a,b,c,d,e,f, x=0,y=0;

while(cin >>a >>b >>c >>d >>e >>f){

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

  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>

using namespace std;

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

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
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 = 1/det*(c*e - b*f);
		double y = 1/det*(-c*d + a*f);	
        if(x<0.0005)x=0;
        if(y<0.0005)y=0;

		cout << fixed << setprecision(3) << x << ' ' << y <<endl;
	}
	return 0;
}

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

using namespace std;

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

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

C++: #include<stdio.h>
#include<stdlib.h>
int main()
{
    int a,b,c,d,e,f;
    double l,k;
    while (scanf ("%d %d %d %d %d %d", &a,&b,&c,&d,&e,&f) != EOF){
        l= a*e-d*b;
        k = b*d - a*e;
        double x = (c*e-b*f)/l;
        double y =(c*d - a*f)/k;

        if(x ==0)
            x = abs(x);
        if(y == 0)
            y = abs(y);

        printf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}

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

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

C++: #include <cstdio>

//input
int a, b, c, d, e, f;

void solve() {
	double x = 1.0 * (c * e - b * f) / (a * e - b * d);
	double y = (c - a * x) / b;
	if (x == -0)x = 0;
	if (y == -0)y = 0;
	printf("%.3lf %.3lf\n", x, y);
}

int main(int argc, char const *argv[]) {
	//  freopen("in.txt", "r", stdin);

	while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
		solve();
	}

	return 0;
}