Go: package main

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

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
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		
		if (x<0.0005 && x>-0.0005){
			x=0;
		}
		if (y<0.0005 && y>-0.0005){
			y=0;
		}
	//	printf("%.3f %.3f\n",x,y);
	//	printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
	//	printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(){
	double matrix[4],ans[2];
	while(scanf("%lf %lf %lf %lf %lf %lf",&matrix[0],&matrix[1],&ans[0],&matrix[2],&matrix[3],&ans[1]) != EOF){
		double t = matrix[0]*matrix[3]-matrix[1]*matrix[2];
		printf("%.3lf %.3lf\n",matrix[3]*ans[0]/t-matrix[1]*ans[1]/t,-matrix[2]*ans[0]/t+matrix[0]*ans[1]/t);
	}
	return 0;
}

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

using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		X=(double)(C*E-F*B)/(A*E-D*B);
		Y=(double)(A*F-D*C)/(A*E-D*B);

		printf("%.3f %.3f\n",X,Y);
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
    int a,b,c,d,e,f;
    while(~scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)){
        double y=(double)(c*d-a*f)/(double)(b*d-a*e);
        if(a!=0)
        printf("%.3f %.3f\n",(c-b*y)/a,y);
        else
        printf("%.3f %.3f\n",(f-e*y)/d,y);
    }
}

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

void solve_SE(double* x, double a, double b, double c, double d, double e, double f)
{
    x[0] = (c * e - f * b) / (a * e - d * b);
    x[1] = (c * d - f * a) / (b * d - e * a);
}

int main()
{
    double a, b, c, d, e, f;
    double x[2];
    while (cin >> a >> b >> c >> d >> e >> f) {
        solve_SE(&x[0], a, b, c, d, e, f);
        cout << x[0] << ' ' << x[1] << endl;
    }
}

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

int main(){
    	int a, b, c, d, e, f;
	double x, y;
	while(1){
	if (!(cin>>a>>b>>c>>d>>e>>f))break;
		x=(double)(1.0/(a*e-b*d))*(e*c-b*f);
		y=(double)(1.0/(a*e-b*d))*(-d*c+a*f);
		cout << (double)x << " " << (double)y << endl;
	}
	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)
	{
		x=(c*(b*d-a*e)-b*(c*d-a*f))/(a*(b*d-a*e));
		y=(c*d-a*f)/(b*d-a*e);
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

double a, b, c, d, e, f;

bool get_input()
{
	return (std::cin >> a >> b >> c >> d >> e >> f);
}

void solve()
{
	double det = a * e - b * d;
	double x, y;

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

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

	std::cout.setf(std::ios::fixed, std::ios::floatfield);
	std::cout.precision(3);
	std::cout << x << ' ' << y << std::endl;
}


int main()
{
	while (get_input()) {
		solve();
	}
	return 0;
}

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double m[2][2],det,inv[2][2],ans[2],x,y;
  while(cin >>m[0][0]>>m[1][0]>>ans[0]>>m[0][1]>>m[1][1]>>ans[1]){
    det = m[0][0]*m[1][1]-m[1][0]*m[0][1];
    inv[0][0] = m[1][1]/det;
    inv[0][1] = -m[0][1]/det;
    inv[1][0] = -m[1][0]/det;
    inv[1][1] = m[0][0]/det;
    x = inv[0][0]*ans[0]+inv[1][0]*ans[1];
    y = inv[0][1]*ans[0]+inv[1][1]*ans[1];
    printf("%.3lf %.3lf\n",x,y);
  }
  return 0;
}

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

C++: #include<cstdio>
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	double x[500];
	double y[500];
	double a, b, c, d, e, f;
	int i = 0;
	do
	{
		cin >> a >> b >> c >> d >> e >> f;
		double sum_d = (a*e - b * d);
		y[i] = (a*f - c * d) / sum_d;
		x[i] = (c * e - b * f) / sum_d;
		++i;
	} while (cin.get() != EOF);
	--i;
	int j = 0;
	for (; j <= i; ++j)
	{
		if ((x[j] - 0) < 0.0001 && (x[j] - 0) > -0.0001)
		{
			x[j] = 0;
		}
		else if ((y[j] - 0) < 0.0001&& (y[j] - 0) > -0.0001)
		{
			y[j] = 0;
		}
		cout<< fixed << setprecision(3) << x[j] << " " << y[j]<<endl;
	}
}

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

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

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

C++: #include <stdio.h>

double dc4pi5(double arg,int n){
	int i = 0;
	for(i = 0;i < n;i++){
		arg *= 10;
	}
	int tmp = (int)arg;
	double ret = tmp;
	if(tmp % 10 <= 4){
		ret -= tmp % 10;
	}else{
		ret += 10 - tmp % 10;
	}
	for(i = 0;i < n;i++){
		ret /= 10;
	}
	return ret;
}

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

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

using namespace std;

int main() {

	double ans[4], coe[12];
	int i;

	for (i = 0; i < 12; i++) 
		cin >> coe[i];
	ans[0] = (coe[2] * coe[4] - coe[1] * coe[5]) / (coe[0] * coe[4] - coe[1] * coe[3]);
	ans[1] = (coe[2] * coe[3] - coe[0] * coe[5]) / (coe[1] * coe[3] - coe[0] * coe[4]);
	ans[2] = (coe[8] * coe[10] - coe[7] * coe[11]) / (coe[6] * coe[10] - coe[7] * coe[9]);
	ans[3] = (coe[8] * coe[9] - coe[6] * coe[11]) / (coe[7] * coe[9] - coe[6] * coe[10]);
	
	for (i = 0; i < 4; i++) {
		if (ans[i] == 0) {
			ans[i] = 0;
		}
	}

	printf("%.3f %.3f\n", ans[0], ans[1]);
	printf("%.3f %.3f\n", ans[2], ans[3]);

	return 0;

}

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

void solv(
	double a,
	double b,
	double c,
	double d,
	double e,
	double f,
	double & x,
	double & y){
	y = (f - (d*c)/a)/(e - (b*d)/a);
	x = (c - b*y)/a;
}

int main(){
	std::vector<std::pair<double, double>> ans;

	double a,b,c,d,e,f;
	std::pair<double, double> tmp;

	while(true){
		std::cin >> a >> b >> c >> d >> e >> f;
		if(std::cin.eof() == true) break;
		solv(a,b,c,d,e,f,
			tmp.first, tmp.second);
		ans.push_back(tmp);
	}

	for(auto && a : ans){
		printf("%0.3f %0.3f\n", a.first, a.second);
	}
}

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

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

	return 0;
}