Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int main(int argc, char const *argv[])
{
	int a,b,c,d,e,f;
	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF)
	{
		float ad = (float)d / (float)a;
		float y = ((float)c * ad - (float)f) / ((float)b * ad - (float)e);
		float x = ((float)c - (float)b*y)/(float)a;
		printf("%.3f %.3f\n", x, y);
	}
	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)
	{
		if (a == 0)
		{
			double x = (c * f - b * e) / d;
			double y = b / c;
			printf("%.3f %.3f\n", x, y);
		}
		else
		{
			double x = (c / a) - (a * b * f - b * c * d) / (a * a * e - a * b * d);
			double y = (a * f - c * d) / (a * e - b * d);
			printf("%.3f %.3f\n", x, y);
		}
	}

	return 0;
}

C++: #include<stdio.h>
int main(void){
  float a,b,c,d,e,f,x,y;
  int j=0,i=0;
  float n[2][1000];
  while(scanf("%d %d %d %d %d %d",&a, &b, &e, &c, &d, &f)!=EOF){
    if(a*d-b*c!=0){
      
    x=(d*e-b*f)/(a*d-b*c);
    y=(a*f-c*e)/(a*d-b*c);
    n[0][i]=x;
    n[1][i]=y;
     i++;}}
 
  while(j<i){
    printf(" %.3f %.3f\n",n[0][j],n[1][j]);
    j++;  
}



  return 0;
}

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

#define times(n, i) uptil(0, n, i)
#define upto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi i <= _##i poi i++)
#define uptil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f) poi i < _##i poi i++)
#define downto(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi i >= _##i poi i--)
#define downtil(f, t, i) for(auto i = (f), _##i = decltype(i)(t) poi i > _##i poi i--)

#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define poi ;
#define poipoi << "\n"

using namespace std;

template<class T> T lov_yet(T t){
    if(t) return t poi
    else return 0 poi
}

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

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	int man(int x, int y);
	double b, c, e, f, x, y, z, k, l;
	
	double a, d;
	while (cin >> a >> b >> c >> d >> e >> f&&a != 0 && b != 0 && c != 0 && d != 0 && e != 0 && f != 0)
	{
		double s = b, v = c;
		b *= d;
		c *= d;
		e *= a;
		f *= a;
		b = b - e;
		c = c - f;
		k = c / b;
		l = (v - s*k) / a;
		cout << setiosflags(ios::fixed) << setprecision(4);
		cout << l << ' ' << k << endl;
	}
	return 0;
	
}

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

int main() {
	int a, b, c, d, e, f; double x, y;
	while (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 << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

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

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

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

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

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

    if(a >= d && fmodf(a, d) == 0) {
      y = (c - (f * (a / d))) / (b - (e * (a / d)));
      x = (c - (b * y)) / a;
    }
    else if(a < d && fmodf(d, a) == 0) {
      y = (f - (c * (d / a))) / (e - (b * (d / a)));
      x = (c - (b * y)) / a;
    }
    else if(b >= e && fmodf(b, e) == 0) {
      x = (c - (f * (b / e))) / (a - (d * (b / e)));
      y = (c - (a * x)) / b;
    }
    else if(b < e && fmodf(e, b) == 0) {
      x = (f - (c * (e / b))) / (d - (a * (e / b)));
      y = (c - (a * x)) / b;
    }
    else {}

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

  return 0;
}

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

double zc(double n) {
	if (-0.000000001<n&&n <= 0) return 0;
	else return n;
}

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

}

C++: #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 = (b * f - c * e) / (b * d - a * e);
		y = (c * d - a * f) / (b * d - a * e);
		if(-0.0005 < x && x <= 0.0) x = 0.0;
		if(-0.0005 < y && y <= 0.0) y = 0.0;
		printf("%.3lf %.3lf\n", x, y);
	}

	return 0;
}

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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    if (b * e - e * b) {
      x = (c * e + f * b) / (a * e - d * b);
    } else {
      x = (c * e - f * b) / (a * e - d * b);
    }
    y = (c - a * x) / b;
    cout << x << ' ' << y << '\n';
  }
  return 0;
}

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

int main() {
  for(double a, b, c, d, e, f; scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF; ) {
    double det = a * e - b * d;
    double x = (e * c - b * f) / det;
    double y = (-d * c + a * f) / det;
    printf("%.4f %.4f\n", x + 1e-8, y + 1e-8);
  }
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>

using namespace std;



int main()
{
	double a, b, c, d, e, f;
	double x, y;
	
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		x = (b*f - e*c) / (b*d - a*e);
		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;
}

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

using namespace std;

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