Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE == 0 {
			bE = 1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		fmt.Print(x)
		fmt.Print(".000 ")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

C++: #include <stdio.h>
int main(){
	float a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
	float x = 0,y = 0;

	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f) != EOF){
		b *= d / a;
		c *= d / a;
		a *= d / a;
		y = (c - f) / (b - e);
		x = (c - b * y) / a;

		if(x == -0){
			x = 0;
		}
		printf("%0.3f %0.3f\n",x,y);

	}

	return 0;
}

C++: 
import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {
	
	Scanner sc = new Scanner(System.in);
	
	void run() {
		
		int a,b,c,d,e,f;
		
		while ( sc.hasNext() ) {
			
			a = sc.nextInt();
			b = sc.nextInt();
			c = sc.nextInt();
			d = sc.nextInt();
			e = sc.nextInt();
			f = sc.nextInt();
			
			System.out.printf( "%.3f %.3f\n",(double)(e*c-b*f)/(a*e-b*d)+0.00005,(double)(a*f-c*d)/(a*e-b*d)+0.00005 );
			
		}
		
	}
	
	public static void main(String[] args) {
		
		new Main().run();
		
	}
}

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 - c * e) / (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 <iostream>
#include <cstdio>

using namespace std;

double round(double x)
{
	return (int)(x + 0.5 - (x < 0));
}

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

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>

using namespace std;



int main()
{
	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 - c*d) / (a*e - b*d);
		printf("%.3f %.3f\n", x, y);
	}
	
	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 <vector>
#include <algorithm>
using namespace std;
int main(){
int a,b,c,d,e,f;
double x,y;
while(cin >> a >> b >> c >> d >> e >> f){
y = (c/a-f/d)/(b/a-e/d);
x = (c-b*y)/a;
cout << x << " " << y << endl;
}
}

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<stdio.h>
using namespace std;
int main(){
double a,b,c,d,e,f;
double x,y;
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);
 }
}

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

C++: #include<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
int a, b, c, d, e, f;

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

C++: #include <utility>
#include <iostream>
#include <cmath>
#include <cstdio>

// ax + by = e1
// cx + dy = e2
auto solve (double a , double b , double e1 , double c , double d , double e2) -> std::pair <double , double>
{
    auto delta = a * d - b * c;
    return std::make_pair ((d * e1 - b * e2) / delta , (a * e2 - c * e1) / delta);
}

auto show (double v) -> std::string
{
    char s [100];
    if (-0.0005 < v && v < 0.0005)
    {
        return "0.000";
    }
    std::sprintf (s , "%.3f" , v);
    return s;
}

auto main () -> int
{
    double a , b , c , d , e , f;
    while (std::cin >> a >> b >> c >> d >> e >> f)
    {
        auto xy = solve (a , b , c , d , e , f);
        std::cout << show (xy.first) << ' ' << show (xy.second) << std::endl;
    }
}

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

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

	return 0;
}

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

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

	while(1){
		getline( cin, str );
		if( str.size()==0 ){
			break;
		}
		sscanf( str.c_str(), "%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f );

		double D  = a*e-b*d;
		double D1 = c*e-f*b;
		double D2 = a*f-d*c;
		x = D1 / D;
		y = D2 / D;

		bool isX = ( (c-a*x)/b == (f-d*x)/e );
		bool isY = ( (c-b*y)/a == (f-e*y)/d );
		if( !isX && isY ){
			x = 0.0;
			y = c/b;
		}else if( isX && !isY ){
			y = 0.0;
			x = c/a;
		}else if( !isX && !isY ){
			x = y = 0.0;
		}

		if( x == -0.000 )	x = 0.000;
		if( y == -0.000 )	y = 0.000;

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

	return 0;
}