Go: package main

import "fmt"

func main() {
	var resultX, resultY [100]float32
	var count int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		//Simultaneous equation
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		resultX[count] = x
		resultY[count] = y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%.3f %.3f\n", resultX[i], resultY[i])
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

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

C++: #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(void){
	long long a, b, c, d, e, f;
	long long p, q, r;
	long long x, y, z;
	for (; scanf("%lld %lld %lld %lld %lld %lld", &a, &b, &c, &d, &e, &f) !=EOF;){
		c = c * 1000;
		f = f * 1000;
		p = (a*e) - (d*b);
		q = (c*e) - (f*b);
		x = q / p;
		p = (b*d) - (e*a);
		q = (c*d) - (f*a);
		y = q / p;
		printf("%lld.", x / 1000);
		printf("%03lld\n", x % 1000);
		printf("%lld.", y / 1000);
		printf("%03lld\n", y % 1000);
	}

		return 0;
	}

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

#define EPS (1e-10)

using namespace std;
//?
int main(void){
	double a,b,c,d,p,q;
	while(cin >> a >> b >> p >> c >> d >> q){
		double delta = a*d-b*c;
		double x,y;
		x = (d*p-b*q)/delta;
		y = (-c*p+a*q)/delta;
		printf("%.3f %.3f\n",x+EPS,y+EPS);
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <cstdio>

using namespace std;

int fugo(double r) {
	return r < 0 ? -1 : 1;
}
double Abs(double r) {
	return r < 0 ? -r : r;
}

int main() {
	char s[1000];
	while (1) {
		string str;
		if ( !getline(cin, str) ) break;

		for (int i = 0; i < str.size(); ++i)
			s[i] = str[i];
		s[str.size()] = '\0';

		double a, b, c, d, e, f;
		sscanf(s, "%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);

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

		x = fugo(x) * (int)(Abs(x) * 10000 + 5) / 10 / 1000.0;
		y = fugo(y) * (int)(Abs(y) * 10000 + 5) / 10 / 1000.0;

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

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

int det(int a00, int a01, int a10, int a11)
{
	return a00*a11 - a01*a10;
}

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

C++: #include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


V<string> split(const string& s, char c) {
  V<string> res;
  stringstream ss(s);
  string t;
  while (getline(ss, t, c)) res.push_back(t);
  return res;
}

int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  string s;
  while (getline(cin, s)) {
    auto ss = split(s, ' ');
    double a = stod(ss[0]);
    double b = stod(ss[1]);
    double c = stod(ss[2]);
    double d = stod(ss[3]);
    double e = stod(ss[4]);
    double f = stod(ss[5]);
    double x = (c * e - f * b) / (a * e - d * b) + 1e-10;
    double y = (c * d - f * a) / (b * d - e * a) + 1e-10;
    cout << fixed << setprecision(3) << x << ' ' << y << '\n';
  }
}

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

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
#define j bai;
int main() {
	double a, b, c, d, e, y, x, f, bai;
	bool bo = false;
	while (cin >> a >> b >> c >> d >> e >> f) {
		if (a ==0 || b ==0) {
			if (a) {
				y = c / b;
				x = f / d - e*y;
			}
			else if (b) {
				x = a / c;
				y = f / e - d*x;
			}
			bo = true;
		}
		else if (d == 0 || e == 0) {
			if (d) {
				y = f / e;
				x = c / a - d*y;
			}
			else if (e) {
				x = f / d;
				y = f / e - d*x;
			}
			bo = true;
		}
		
		else if (a < d) {
			bai = d / a;
			a *= j;
			b *= j;
			c *= j;
		}
		else {
			bai = a / d;
			d *= j;
			e *= j;
			f *= j;
		}
		if (((a > 0 && d < 0) || (a < 0 && d>0)) && bo==false) {
			y = (c + f) / (b + e);
			x = (c - b*y) / a;
		}
		else if (bo == false) {
			y = (c - f) / (b - e);
			x = (c - b*y) / a;
		}
		if (x == -0.000) {
			x = abs(x);
		}
		if (y == -0.000) {
			y = abs(y);
		}
		printf("%.3lf %.3lf\n", x, y);
	}
	return 0;
}

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

using namespace std;

int main()
{
    //freopen("input.txt", "r", stdin);
    double a, b, c, d, e, f;
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f)!= EOF){
        double x, y;
        x = ((b*f)-(c*e))/((b*d)-(a*e));
        y = (c-(a*x))/b;

       cout << setprecision(3) << x << " " << y << endl;
    }

    return 0;
}

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

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

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

using db = double;

int main() {
	cout << fixed << setprecision(3);
	ios :: sync_with_stdio(false);
	db a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f) {
		db x = (c * e - b * f) / (a * e - b * d);
		db y = (a * f - c * d) / (a * e - b * d);
		cout << x << ' ' << y << '\n';
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double a, b, c, d, e, f;
  double x, y;
  cin >> a >> b >> c >> d >> e >> f;
  x = (c * e - b * f) / (a * e - b * d);
  y = (a * f - c * d) / (a * e - b * d);
  cout << x << " " << y << endl;
  return 0;
}