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>

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

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main(void){
    float a,b,c,d,e,f,x,y;
    while(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);
        if(x==0)x=0;
        if(y==0)y=0;
        cout<<fixed<<setprecision(3)<<x<<" "<<fixed<<setprecision(3)<<y<<endl;
        }
        return 0;
}

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

int main(void){
	double x1[1000],y1[1000];
	int a[1000],b[1000],c[1000],d[1000],e[1000],f[1000],i=0,j,r=0,x2[1000],y2[1000];
    
    while(r==0)
	{
		scanf("%d %d %d %d %d %d",&a[i],&b[i],&c[i],&d[i],&e[i],&f[i]);
	    x2[i] = (c[i] * e[i] -b[i] * d[i]) / (a[i] * e[i] - b[i] * d[i])*1000+0.5;
	    y2[i] = (d[i] * c[i] -a[i] * f[i]) / (b[i] * d[i] - a[i] * e[i])*1000+0.5;

		if(a[i] < -1000 || a[i] > 1000  || b[i] < -1000 || b[i] > 1000 ||
		   c[i] < -1000 || c[i] > 1000  || d[i] < -1000 || d[i] > 1000 || 
		   e[i] < -1000  || e[i] > 1000 || f[i] < -1000 || f[i] > 1000)break;
		
		i=i+1;
	}
	for(j=0;j<i;j++)
	{
		x1[j]=x2[j]/1000;
		y1[j]=y2[j]/1000;
		printf("%f %f\n",x1[j],y1[j]);
	}
  return 0;
}

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

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

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

template<typename T> void simultaneous_equation(T &x, T &y, T a, T b, T c, T d, T e, T f)
{
	if (a == 0 || b == 0 || d == 0 || e == 0)
	{
		if (a == 0)
		{
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (b == 0)
		{
			x = c / a;
			y = (f - d * x) / e;
		}

		if (d == 0)
		{
			y = f / e;
			x = (c - b * y) / a;
		}
		else if (e == 0)
		{
			x = f / d;
			y = (c - a * x) / b;
		}
	}
	else
	{
		double a0 = a * e;
		double c0 = c * e;

		double d0 = d * b;
		double f0 = f * b;

		x = (f0 - c0) / (d0 - a0) + 0;

		y = (c - a * x) / b + 0;
	}
}

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

		simultaneous_equation(x, y, a, b, c, d, e, f);
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
}

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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

  for (Real a,b,c,d,e,f; cin >> a >> b >> c >> d >> e >> f, cin; ) {

    Real det = a * e - b * d;
    Real x = e * c - b * f;
    Real y = - d * c + a * f;
    x /= det;
    y /= det;
    if (x == -0.0) x = 0.0;
    if (y == -0.0) y = 0.0;
    printf("%0.3f %0.3f\n", x, y);

  }

  return 0;
}

C++: /*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=jp*/

#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",((int)((c * e - b * f) / (a * e - b * d)*10e3+0.5))/10e3,((int)((a * f - c * d) / (a * e - b * d)*10e3+0.5))/10e3);
    }
    return 0;
}

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

#define MAX 256

int main(void){

	double a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
	double ansx[MAX], ansy[MAX];

	for (int i = 0; i < MAX; i++){
		ansx[i] = 0;
		ansy[i] = 0;
	}


	int i = 0;

	while (scanf("%lf%lf%lf%lf%lf%lf%lf", &a,&b,&c,&d,&e,&f) != EOF){
		ansx[i] = (c*e - b*f) / (a*e - b*d);
		ansy[i] = (c*d - a*f) / (b*d - a*e);
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3lf %.3lf\n", ansx[j], ansy[j]);
	}

	return 0;
}

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

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

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

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

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

		if(cin.eof()){
			break;
		}

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

		if(x == 0){
			x = 0;
		}
		if(y == 0){
			y = 0;
		}

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

	return 0;
}

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

using namespace std;

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

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

	x *= 1000;
	y *= 1000;
	x = int(x);
	y= int(y);
	x = x / 1000;
	y = y / 1000;
 	
 	printf("%.3lf %.3lf\n",x,y);
	}
 return 0;
}

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