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++: use std::io::{stdin, BufRead, BufReader};

fn main(){
    let input = BufReader::new(stdin());

    for line in input.lines(){
        
        let v: Vec<f32> = line.unwrap().split_whitespace().filter_map(|x| x.parse::<f32>().ok()).collect();
        
        println!("{:.3} {:.3}", (v[2]*v[4]-v[1]*v[5])/(v[0]*v[4]-v[1]*v[3]),(v[2]*v[3]-v[0]*v[5])/(v[1]*v[3]-v[0]*v[4]));
    }
}
    

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
 
pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n {
        vs.push(readln());
    }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(
    String,
    bool,
    f32,
    f64,
    isize,
    i8,
    i16,
    i32,
    i64,
    usize,
    u8,
    u16,
    u32,
    u64
);
impl<T> FromLn for Vec<T>
where
    T: FromLn,
{
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);

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

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

using namespace std;

static vector<double> solve_simultaneous(const vector<double> &set) {
	vector<double> result(2, 0);
	result.at(0) = ( ((set.at(2)/set.at(1)) - (set.at(5)/set.at(4)))
		/((set.at(0)/set.at(1)) - (set.at(3)/set.at(4))) );

	result.at(1) = ( ((set.at(2)/set.at(0)) - (set.at(5)/set.at(3)))
		/((set.at(1)/set.at(0)) - (set.at(4)/set.at(3))) );

	return result;
}

int main(void) {
	int dataset_counter = 0;
	double check_input = 0;
	vector<vector<double> > input;

	while (cin >> check_input) {
		input.push_back(vector<double>(6));
		input.at(dataset_counter).at(0) = check_input;
		for (int i = 1; i < 6; i ++) {
			double temp;
			cin >> input.at(dataset_counter).at(i);
		}

		dataset_counter ++;
	}

	for (vector<double> dataset : input) {
		vector<double> result(2, 0);
		result = solve_simultaneous(dataset);

		cout << fixed;
		cout << setprecision(3) << result.at(0) << " "
		<< setprecision(3) << result.at(1) << endl;
	}

	return 0;
}

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

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 / e)*f) / (a - (b / e)*d);
		y = (c - a*x) / b;

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

	return 0;
}

C++: #include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int main(){
	double a,b,c,d,e,f,a1;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x,y,x1,y1;
		a1=a;
		a=a*d;
		b=b*d;
		c=c*d;
		d=d*a1;
		e=e*a1;
		f=f*a1;
		y=(c-f)/(b-e);
		x=(f-e*y)/d;
		if(x<0.001&&x>=0) x=0;
		if(y<0.001&&y>=0) y=0;
		if(x<-0.001) x=0;
		if(y<-0.001) y=0;
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include <math.h>
#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 = (c*e - b*f) / (a*e - b*d);
		double y = (c - a*x) / b;

		x = ( (double)( (int)(x * 1000) ) ) / 1000;
		y = ( (double)( (int)(y * 1000) ) ) / 1000;

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

C++: #include <stdio.h>
#include<string>
#include<string.h>
#include <math.h>
#include<iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace  std;


/*
//my header
#include "define.h"
#include "geometry.h"*/


void init()
{
#ifdef _WIN32
	freopen("1.txt", "r", stdin);
#endif
}

void func();

int main()
{
	init();
	func();

	return 0;
}


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

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

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

    while (!cin.eof()){
        cin>>a>>b>>c>>d>>e>>f;
        double D=a*e-b*d;
        double X=(c*e-f*b)/D,Y=(a*f-d*c)/D;
        if (X==-0.0) X=0.0;
        if (Y==-0.0) Y=0.0;
        printf("%.3lf %.3lf\n",X,Y);

    }
    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 %.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>
#include<algorithm>
using namespace std;
int main(){
    double a,b,c,d,p,q;
    while(cin>>a>>b>>p>>c>>d>>q){
        double x=(b*q-d*p)/(b*c-a*d);
        double y=(a*q-c*p)/(a*d-b*c);
        if(x<=0.0&&x>-0.00001)x=0.0;
        if(y<=0.0&&y>-0.00001)y=0.0;
        printf("%.3f %.3f\n",x,y);
    }

    return 0;
}

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

int main() {
  for(int i = 0; i < 31; i++){
    int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
    double x, y;
    cin >> a >> b >> c >> d >> e >> f;
    /*ax + by = c
      dx + ey = f
      行列で処理...?*/

      if(a == 0 && b == 0 && c == 0 && d == 0 && e == 0 && f == 0){
        break;
      }
      else{
        d * a * x + d * b * y - a * d * x - a * e * y == d * c - a * f;
        (d * b - a * e) * y == d * c - a * f;
        y = (d * c - a * f) / (d * b - a * e);
        //double Y = round(y * 1000); //1000倍して四捨五入して小数第4位までを取得
        //y = Y / 1000;
        x = (c - b * y) / a;
        //double X = round(x * 1000);
      //  x = X / 1000;

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

}

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 Dx = c*e-b*f;
 double Dy = a*f-c*d;
 double D  = a*e-b*d;
 cout << fixed << setprecision(3) << Dx/D << ' ' << Dy/D << endl;
 }
return 0;
}