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 <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)

double det(double a1,double a2,double a3,double a4){
	return a1*a4-a2*a3;
}

int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double g,h,i;
		g = det(a,b,d,e);
		h = det(c,b,f,e);
		i = det(a,c,d,f);
		double j,k;
		j = h/g;
		k = i/g;
		j = round(j*pow(10,4))/pow(10,4);
		k = round(k*pow(10,4))/pow(10,4);
		printf("%.3f %.3f",j,k);
	}
	return 0;
}

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> out;
  while (cin>>a>>b>>c>>d>>e>>f){
    out.push_back((c*e-b*f)/(a*e-b*d));
    out.push_back((c*d-a*f)/(b*d-a*e));
  }
  for (int i=0;i<out.size();i+=2){
    printf("%.3f %.3f\n",round(out[i]*1000)/1000.0,round(out[i+1]*1000)/1000.0);
  }
  return 0;
}

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

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f)
	{
		y=(c*d-a*f)/(b*d-a*e);
		x=(c-(b*y))/a;
		cout<<setiosflags(ios::showpoint)<<setprecision(4)<<x<<" "<<y<<endl;
	}
	return 0;
}

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

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

C++: 
/*
 * main.cpp
 *
 *  Created on: 2011/04/01
 *      Author: satoki
 *      22:08 ~ 04/09 10:51
 *      »ê¼êÆ§Åððo·
 */
#include <iostream>
#include <string.h>
using namespace std;

double dA;
double dB;
double dC;
double dD;
double dE;
double dF;

double dX;
double dY;

bool input() {
  if (scanf("%lf %lf %lf %lf %lf %lf", &dA, &dB, &dC, &dD, &dE, &dF) == EOF) return false;
  return true;
}

void manage() {
  int tmp;

  dX = (dC * dE - dB * dF) / (dA * dE - dB * dD);
  dY = (dC * dD - dA * dF) / (dB * dD - dA * dE);

  tmp = (int)dX;
  dX -= tmp;
  dX = (int)(dX * 1000 + 0.5 - (dX < 0)) / (double)1000;
  dX += tmp;
  tmp = (int)dY;
  dY -= tmp;
  dY = (int)(dY * 1000 + 0.5 - (dY < 0)) / (double)1000;
  dY += tmp;
}

int main() {
  while (1) {
    if (!input()) break;
    manage();
    printf("%.3f %.3f\n", dX, dY);
  }
}

C++: #include <iostream>
#include <stdio.h>
#define swap(a,b) {a=a+b; b=a-b; a=a-b;}
using namespace std;

void q4() {
	double a, b, c, d, e, f;
	for (;;) {
		cin >> a >> b >> c >> d >> e >> f;
		//scanf_s("%lf %lf %lf %lf %lf %lf\n", &a, &b, &c, &d, &e, &f);

		if (a == 0) {
			swap(a, d);
			swap(b, e);
			swap(c, f);
		}
		b /= a;
		c /= a;
		a = 1;

		e -= b * d;
		f -= c * d;
		d = 0;

		f = f / e;
		e = 1;
		
		c -= f * b;
		b = 0;

		printf("%4lf %4lf\n", c, f);
	}
}

int main() {
	q4();
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
double dat(double a,double b,double c,double d) {
	return a*d - b*c;
}
int main() {
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f) {
		// クラメルの公式を利用
		double A = dat(a,b,d,e);
		//if(A == 0)
		//	cout << "error" << endl;
		double A1 = dat(c,b,f,e);
		double A2 = dat(a,c,d,f);
		
		// x y
		double x = A1/A;
		double y = A2/A;
		
		// 小数点第4位で四捨五入
		int x_cp;
		int y_cp;
		if(x < 0)
			x_cp = (int)(x*1000 - 0.5);
		else
			x_cp = (int)(x*1000 + 0.5);
		if(y < 0)
			y_cp = (int)(y*1000 - 0.5);
		else
			y_cp = (int)(y*1000 + 0.5);
		
		x = (double)x_cp / 1000;
		y = (double)y_cp / 1000;
		
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

int main(){
    float a, b, c, d, e, f, x, y, dividedNum1, dividedNum2 = 0;
    while(cin >> a >> b >> c >> d >> e >> f){
        dividedNum1 = a;
        dividedNum2 = d;
        a /= dividedNum1;
        b /=dividedNum1;
        c /= dividedNum1;
        d /= dividedNum2;
        e /= dividedNum2;
        f /= dividedNum2;
        
        float temp1 = b - e;
        float temp2 = c - f;
        
        y = floor((temp2 / temp1) * 1000 + 0.0005) / 1000;
        x = floor((c - (b * y) ) * 1000 + 0.0005) / 1000;
        
        cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  double x, y;
  cin >> a >> b >> c >> d >> e >> f;
  x = (b * f - c * e) / (b * d - a * e);
  y = (a * f - c * d) / (a * e - b * d);
  printf("%.3f %.3f", floor(x * 1000.0) / 1000.0, floor(y * 1000.0) / 1000.0);
  return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    double det = a*e - b*d;
    double x = (e*c-b*f)/det;
    double y = (-d*c+a*f)/det;

    cout.setf(ios::showpoint);
    cout.precision(4);
    cout << x << ' ' << y << endl;

  }
  return 0;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include<algorithm>
#define pf printf
#define sf scanf
#define wh while
#define db double
#define LL long long
#define _USE_MATH_DEFINES
#define re(i,a,b) for(int i=a;i<b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

int main()
{
    db a,b,c,d,e,f,x,y;
    wh(sf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)==6){
        if((e*c-b*f)==0)x=0;
        else x=(e*c-b*f)/(a*e-b*d);
        y=(c-a*x)/b;
        pf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ????????§ ax+by=c, dx+ey=f ????§£?????????????????¨???????????¨???????¨????????????????(1)
    vector<vector<double>> answers;
    double a, b, c, d, e, f;
    int dump;
    while(cin >> a >> b >> c >> d >> e >> f) {
        double det = (double)(a*e-b*d);
        double ansx = (e*c+(-b)*f)/det;
        double ansy = ((-d)*c+a*f)/det;
        answers.push_back({ansx,ansy});
    }
    for(auto elm : answers) {
        cout << fixed << setprecision(3) << elm[0] << " " << elm[1] << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
    int a[3];
    int b[3];
    int y[3];
    int x[3];
    while(true) {
    REP(i,3)
        cin >> a[i];
    REP(i,3)
        cin >> b[i];
    if(!cin)
        return 0;
    double o[2];
        o[0] = b[1]*a[2] - a[1]*b[2];
        o[1] = -b[0]*a[2] + a[0]*b[2];
    REP(i,2)
        o[i] = (o[i]==0)?0:o[i]/(a[0]*b[1]-b[0]*a[1]);
    cout << fixed << setprecision(3) << o[0] << ' ';
    cout << fixed << setprecision(3) << o[1] << '\n';
    }
}

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

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