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 <iostream>
#include <iomanip>
#include <cmath>

double nth_round(double value, int n) {
    double scale = pow(10, n - 1);
    return std::round(value * scale) / scale;
}

int main() {
    double a, b, c, d, e, f;
    double coef;
    
    while (std::cin >> a >> b >> c >> d >> e >> f) {
        coef = 1. / (a * e - b * d);
        std::cout << std::setprecision(3)
                  << std::fixed
                  << nth_round(coef * (c * e - b * f), 4) << " "
                  << nth_round(coef * (a * f - c * d), 4) << std::endl;
    }

    return 0;
}

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

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

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

C++: #include <cstdio>
void calc(int x1, int y1, int a, int x2, int y2, int b)
{
	double d1 = x2;
	double d2 = x1;
	double xx1 = d1 * x1;
	double xy1 = d1 * y1;
	double a1 = d1 * a;
	double xx2 = d2 * x2;
	double xy2 = d2 * y2;
	double b1 = d2 * b;
	double y = xy1 - xy2;
	double c = a1 - b1;
	y = c / y;


	d1 = y2;
	d2 = y1;
	xx1 = d1 * x1;
	xy1 = d1 * y1;
	a1 = d1 * a;
	xx2 = d2 * x2;
	xy2 = d2 * y2;
	b1 = d2 * b;
	double x = xx1 - xx2;
	c = a1 - b1;
	x = c / x;
	if (x == 0)
	{
		x = 0;
	}
	if (y == 0)
	{
		y = 0;
	}
	printf("%.3lf %.3lf\n", x, y);
}
int main(int argc, char const *argv[])
{
	int x1, y1, a, x2, y2, b;

	while(scanf("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF)
	{
		calc(x1, y1, a, x2, y2, b);
	}

		
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
  double a,b,c,d,e,f,x,y;
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){
    x = (c-b*(c*d-a*f)/(b*d-a*e))/a; 
    y = (c*d-a*f)/(b*d-a*e);
    if(x == -0)x = 0;
    if(y == -0)y = 0;
    printf("%.3f %.3f",x,y);
  }
}

C++: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                double x, y;
                double[] h = new double[6];
                String str = Console.ReadLine();
                if (str == null) break;
                string[] s = str.Split();
                for (int i = 0; i < 6; i++)
                {
                    h[i] = double.Parse(s[i]);

                    x = ((h[2] * h[4]) - (h[1] * h[5])) / ((h[0] * h[4]) - (h[1] * h[3]));
                    y = ((h[2] * h[3]) - (h[0] * h[5])) / ((h[3] * h[1]) - (h[0] * h[4]));
                    x = Math.Floor(x * 1000) / 1000;
                    y = Math.Floor(y * 1000) / 1000;
                    Console.WriteLine("{0:0.000} {1:0.000}", x, y);

                }
            }
        }
    }
}

C++: #include<cstdio>
#include<cmath>
int main(){
    double a[6];
    double x,y;
    while(~scanf("%lf",&a[0])){
        for(int i=1;i<6;i++){
            scanf("%lf",&a[i]);
        }
        y=(a[2]-(a[5]*(a[0]/a[3])))/(a[1]-(a[4]*(a[0]/a[3])));
        x=(a[2]-a[1]*y)/a[0];
        printf("%.3lf %.3lf\n",rint(x*1000)/1000.0,rint(y*1000)/1000.0);
    }
}

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

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

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

}

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

using namespace std;
int main() {
    float a,b,c,d,e,f,x,y;
    while(cin >> a){
        cin >> b;
        cin >> c;
        cin >> d;
        cin >> e;
        cin >> f;

        x = (-f+e*c/b)/(-d+a*e/b);
        y = (c-a*x)/b;
        x *= 1000;
        y *= 1000;
        x += 0.5f;
        y += 0.5f;
        x = (int)x;
        y = (int)y;
        x /= 1000.0f;
        y /= 1000.0f;
        printf("%.3f %.3f\n",x,y);

    }
    return 0;

}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define N 1024

int main()
{
	char buff[N];
	
	while (NULL != fgets(buff, N, stdin))
	{
		double a, b, c, d, e, f;
		sscanf(buff, "%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);
		
		double dd = a * e - b * d;
		double x = ( e * c - b * f ) / dd + 0.0;
		double y = ( - d * c + a * f ) / dd + 0.0;
		
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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

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

using namespace std;

int w[2][2];
int w0[2];

void solve(){
    float a0 = w[0][0] * w[1][1] - w[0][1] * w[1][0];
    int a1 = w0[0] * w[1][1] - w[0][1] * w0[1];
    int a2 = w[0][0] * w0[1] - w0[0] *w[1][0];
    float x = a1 / a0, y = a2 / a0;
    printf("%.3f, %.3f", x, y);
}

int main(){
    while(cin >> w[0][0] >> w[0][1] >> w0[0] >> w[1][0] >> w[1][1] >> w0[1]){
        solve();
    }
    return 0;
}

C++: #include <bits/stdc++.h>
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++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

using namespace std;

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