Go: package main

import (
        "fmt"
        "bufio"
        "os"
        "math"
)

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
                if x == 0.0 {
                        x = math.Abs(x)
                }
                if y == 0.0 {
                        y = math.Abs(y)
                }
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

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


double a,b,c,d,e,f;
double x,y;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    

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

    if(y > 0){
      y =floor((y+0.0005)*1000)/1000;
    }
    if(y < 0){
      y =-floor((fabs(y)+0.0005)*1000)/1000;
    }
    if(x > 0){//小数第4位を四捨五入
      x =floor((x+0.0005)*1000)/1000;
    }
    if(x <0){
      x =-floor((fabs(x)+0.0005)*1000)/1000;
    }
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define PI 3.1415926535897
#define EPS (1e-10)
#define INF INT_MAX
#define INFLL LLONG_MAX
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using MCI = std::map<char, int>;
using VPII = std::vector<PII>;
using namespace std;


signed main(){
	double a, b, c, d, e, f;
	double A, B, C;
	double x, y;
	while(cin >> a >> b >> c >> d >> e >> f){
		A = (a*e) - (b*d);
		B = (c*e) - (b*f);
		C = (a*f) - (c*d);

		x = round(B/A*1000)/1000;
		y = round(C/A*1000)/1000;

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

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

	return 0;
}

C++: #include <stdio.h>

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

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

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

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

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

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

		std::cout << std::fixed << std::setprecision(3) << x << " " << std::fixed << std::setprecision(3) << y << std::endl;

	}
}

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

int main() {
	int a, b, c, d, e, f;
	int cnt = 0;
	std::vector<double> x_vector;
	std::vector<double> y_vector;

#if 0
	while (!cnt) {
		cnt++;
		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);

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

	for (unsigned int i = 0; i < x_vector.size(); i++) {
		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::setprecision(3) << y_vector[i] << endl;
	}

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

	return 0;
}

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

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REP(i, n) for(int i=0; i<(int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

C++: #include<iostream>
#include<iomanip>
int main()
{
	double result[2000][2];
	int num;
	for(int i = 0;; i++)
	{
		double a, b, c, d, e, f;
		std::cin >> a >> b >> c >> d >> e >> f;
		if(std::cin.eof())
		{
			num = i;
			break;
		}
		result[i][0] = (b * f - c * e) / (b * d - a * e);
		result[i][1] = (c * d - a * f) / (b * d - a * e);
	}
	std::cout << std::fixed << std::setprecision(3);
	for(int i = 0; i < num; i++)
	{
		std::cout << result[i][0] << ' ' << result[i][1] << std::endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;

int main(){
   double a,b,c,d,e,f;
   double x,y;
   int 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);
      
      X = static_cast<int>(x*10000);
      if(X%10>=5){
         X += 10 - (X%5);
         x = static_cast<double>(X /10000);
      }
      Y = static_cast<int>(y*10000);
      if(Y%10>=5){
         Y += 10 - (Y%5);
         y = static_cast<double>(Y /10000);
      }
      if(0 == static_cast<int>(x))
         x = 0;
      if(0 == static_cast<int>(y))
         y = 0;
      
      printf("%.3lf %.3lf\n",x,y);
      
   }
   return 0;
}

C++: 
def ans(a, b, c, d, e, f):
    x = ((e*c - b*f)/(a*e-b*d))
    y = ((-d*x + f)/e)
    x = "%.3f" % x
    y = "%.3f" % y
    return x, y


sets = []

while True:
    try:
        line = list(map(int, input().split()))
        if(line[0] == " "):
            break;
        else:
            sets.append(line)
    except IndexError:
        break

for i in sets:
    x, y = ans(i[0],i[1],i[2],i[3],i[4],i[5])
    print(x, y)