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 <cmath>
#include <cstdio>
#include <cfloat>

namespace
{
	struct equation
	{
		double a, b, c;
	};
	auto calculate_x = [](equation e1, equation e2)
	{
		return (e1.c * e2.b - e1.b * e2.c) / (e1.a * e2.b - e1.b * e2.a);
	};
	auto calculate_y = [](equation e1, equation e2)
	{
		return (e1.c * e2.a - e1.a * e2.c) / (e1.b * e2.a - e1.a * e2.b);
	};
	auto round_off = [](double d, unsigned int digit)
	{
		d *= std::pow(10, digit - 1);
		d = std::round(d);
		d /= std::pow(10, digit - 1);
		return d;
	};
}

namespace
{
	equation e1, e2;
}

int main()
{
	while (std::scanf("%lf", &e1.a) != EOF)
	{
		std::scanf("%lf%lf%lf%lf%lf", &e1.b, &e1.c, &e2.a, &e2.b, &e2.c);
		double x = round_off(calculate_x(e1, e2), 4);
		double y = round_off(calculate_y(e1, e2), 4);
		std::printf("%.3f %.3f\n", x + DBL_EPSILON, y + DBL_EPSILON);
	}
	return 0;
}

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

int main() {
	float a[6];
	float x,y;
	while(true)
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];
		if(cin.eof())
			break;
			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		
		cout.precision(3);
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextInt()) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int c = scanner.nextInt();
            int d = scanner.nextInt();
            int e = scanner.nextInt();
            int f = scanner.nextInt();

            Equation equation_1 = new Equation(a, b, c);
            Equation equation_2 = new Equation(d, e, f);

            double[] solution = solve(equation_1, equation_2);

            System.out.printf("%.3f %.3f\n", solution[0], solution[1]);
        }
    }

    static double[] solve(Equation left, Equation right) {
        double determinant = left.a * right.b - right.a * left.b;
        double x = (right.b * left.c - left.b * right.c) / determinant;
        double y = (-right.a * left.c + left.a * right.c) / determinant;

        double[] result = { x, y };
        return result;
    }

}

// ax + by = c
class Equation {

    Equation(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    public int a;
    public int b;
    public int c;

}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

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

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	while (cin >> a >> b >> c >> d >> e >> f) {
		printf("%.3lf %.3lf\n", (e*c-f*b)/(e*a-b*d), (d*c-a*f)/(d*b-a*e));
	}
	
	return 0;
}

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 ",(c-b*(f-d*c/a)/(e-d*b/a))/a);
		printf("%.3f\n",(f-d*c/a)/(e-d*b/a));
	}
	return 0;
}

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

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

	while( cin >> a >> b >> c >> d >> e >> f ) {
		double x, y;

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

		cout << (x == 0 ? setprecision(3) : setprecision(4)) << showpoint << x;
		cout << " " << (y == 0 ? setprecision(3) : setprecision(4)) << y << endl;
	}
}

C++: #include <iostream>
 
using namespace std;
 
#define EPS 1e-9
 
int main()
{
    int a,b,c,d,e,f;
    float x,y,dx,dy;
    while( cin >> a >> b >>c >>d >> e >> f ) {
        x = (c*e-b*f)/(float)(a*e-b*d);
        y = (c - a*x)/(float)b;
         
 
        printf("%.3f %.3f\n",x+EPS,y+EPS);
    }
 
 
 
    return 0;
}

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

int main()
{
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		cout<<(c-b*(f-d*c/a)/(e-d*b/a))/a<<" ";
		cout<<(f-d*c/a)/(e-d*b/a)<<endl;
	}
	return 0;
}

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

using namespace std;

int main() {

	int i;
	double no[6] = { 0 }, a, b;

	while (cin >> no[0]) {
	
	for (i = 1; i < 6; i++) {
			cin >> no[i];
		}
		
		a = ((no[2] * no[4]) - (no[1] * no[5])) / ((no[0] * no[4]) - (no[1] * no[3]));
		b = ((no[3] * no[2]) - (no[0] * no[5])) / ((no[1] * no[3]) - (no[0] * no[4]));
		if (a == 0)
			a = 0;
		if (b == 0)
			b = 0;
		
		printf("%.3f %.3f", a, b);
	} 

	return 0;
}

C++: while(True):
	try:
		a,b,c,d,e,f = map(float,input().split(" "))
		z = a*e - b*d
		if(z!=0):
			x = (c*e-b*f)/z
			y = (a*f-c*d)/z
		print("{:.3f} {:.3f}".format(x+0,y+0))
	except:
		break

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004
#include <bits/stdc++.h>
using namespace std;

int main(){
  for(double a,b,c,d,e,f,x,y; cin>>a>>b>>c>>d>>e>>f;){
    x = (e*c-b*f)/(a*e-b*d);
    y = ((-d)*c+a*f)/(a*e-b*d);

    char buff[100];
    sprintf(buff, "%.3f", x);
    if(!strcmp(buff, "-0.000")) x = 0;
    sprintf(buff, "%.3f", y);
    if(!strcmp(buff, "-0.000")) y = 0;
    cout<<fixed; // ?°???°?????\??????????????????????????????????????????????????°???????????°??????????????????
    cout<<setprecision(3)<<x<<" "<<y<<endl;
  }
  return EXIT_SUCCESS;
}

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

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

void solver() {
    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        auto x = (c * e - f * b) / (a * e - b * d);
        auto y = (c - a * x) / b;
        if(x<0.0005) x=0;
        if(y<0.0005) y=0;
        printf("%.3f %.3f\n",x,y);
    }
}

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

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

using namespace std;

int main(){

  int i=0;
  float a, b, c, d, e, f;
  float temp;
  float x, y;

  while( cin >> a >> b >> c >> d >> e >> f ) {

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

    cout << fixed << setprecision(3) << x << " " << y << "\n";
  }

  return 0;
}

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

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

	cin >> a >> b >> c >> d >> e >> f;

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

	cout << showpoint << setprecision(3);
	cout << setiosflags( ios::fixed );
	cout << x << " " << y << endl;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,b,c,d,e,f;
    double x,y;
    while(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\n",x ,y);
    }
    return 0;
}

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

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

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

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