Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	for {
		data := nextInts(6)
		if data[0] == 0 || data[1] == 0 || data[2] == 0 || data[3] == 0 || data[4] == 0 || data[5] == 0 {
			break
		}
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return ((c * e) - (b * f)) / ((a * e) - (b * d))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return ((c * d) - (a * f)) / ((b * d) - (a * e))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

C++: #include<stdio.h>
void print_answer(int a,int b,int c,int d,int e,int f){
  double x,y;
  y=(c*d-f*a)/(b*d-e*a);
  x=(c-b*y)/a;
  printf("%5.3f ",x);
  printf("%5.3f\n",y);
}

int main(void){
  int n,a[2000],b[2000],c[2000],d[2000],e[2000],f[2000];
  int i=0,j;
  while(scanf("%d",&n)!=EOF){
      a[i]=n;
      scanf("%d",&n);
      b[i]=n;
      scanf("%d",&n);
      c[i]=n;
      scanf("%d",&n);
      d[i]=n;
      scanf("%d",&n);
      e[i]=n;
      scanf("%d",&n);
      f[i]=n;
      i++;
  }
  for(j=0;j<i;j++){
    print_answer(a[j],b[j],c[j],d[j],e[j],f[j]);
  }

  return(0);
}

C++: #include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
	double a1, b1, c1, a2, b2, c2, A, B, C, X, Y;
	while (cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2) {
		A = a1, B = b1, C = c1;
		if (a1 != a2) {
			double tmp = a2 / a1;
			a1 *= tmp, b1 *= tmp, c1 *= tmp;
		}
		Y = (c2 - c1) / (b2 - b1);
		X = (C - B * Y) / A;
		printf("%.3f %.3f\n", X, Y);
	}
	return 0;
}

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;
}