Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		y := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

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


double a,b,c,d,e,f;
double A,B;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    B =(c*e-f*b)/(a*e-b*d);
    A = (c -b*B)/a;
    
    if(A ==0)
      A =0;
    if(B ==0)
      B =0;
    A =floor((A+0.0005)*1000)/1000;//小数第4位を四捨五入
    B =floor((B+0.0005)*1000)/1000;
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: #include <cstdio>

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){

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

  while(cin >> a){
    cin >> b >> c >> d >> e >> f;
    
    if(c*e==f*b||a*e==d*b) printf("0.000 ");
    else printf("%.3f ",(c*e-f*b)/(a*e-d*b));
    if(c*d==f*a||b*d==e*a) printf("0.000\n");
    else printf("%.3f\n",(c*d-f*a)/(b*d-e*a));
  }

  return (0);
}

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

using namespace std;

int main(){

  float a, b, c, d, e, f;
  float temp;
  float x, y;

  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;
    
    while(cin>>a>>b>>c>>d>>e>>f){
        
        y=(d*c-a*f)/(d*b-a*e);
        x=(e*c-b*f)/(e*a-b*d);
        
        if(x==-0)x=0;
        if(y==-0)y=0;
        cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
    }
}

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

using namespace std;

int main(){

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

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

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


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

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	double k[60000]={0};
	int i=0;
	while(cin>>k[i++]);
	int n=i-1;
	for(int j=0;j<n;j+=6){
		double x=0,y=0,a=k[j],b=k[j+1],c=k[j+2],d=k[j+3],e=k[j+4],f=k[j+5];
		x=(c*e-b*f)/(-b*d+a*e);
		y=(c*d-a*f)/(b*d-a*e);
		if(x==0)x=abs(x);
		if(y==0)y=abs(y);
		x*=1000,x=round(x),x/=1000;
		y*=1000,y=round(y),y/=1000;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

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

C++: #include<stdio.h>
int a,b, c, d, e, f;

int main()
{
while(scanf("%d",&a)!=EOF)
	{
		double x,y;
		scanf("%d %d %d %d %d",&b,&c,&d,&e,&f);
		x=(e*c-b*f)/(e*a-b*d);
		y=(c-a*x)/b;
		printf("%0.3f %0.3f\n",x,y);
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	double a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
        x = (double)((e*c-b*f) / (a*e-b*d));
		y = (double)((-(d*c)+a*f) / (a*e-b*d));
    	cout<<setiosflags(ios::fixed)<<setprecision(3)<<x<<" "<<y<<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)
	{
		-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 <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl

double a[6];

void solve(){
	double aa=(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
	double bb=(a[0]*a[5]-a[2]*a[3])/(a[0]*a[4]-a[1]*a[3]);
	if(abs(aa)<EPS)aa=0;
	if(abs(bb)<EPS)bb=0;
	printf("%.3f %.3f\n",aa,bb);
}

int main(){
	while(cin>>a[0]){
		rep(i,5)cin>>a[i+1];
		solve();
	}
	
	return 0;
}

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

void solve()
{
	int a;
	while(cin >> a)
	{
		int b, c, d, e, f;
		cin >> b >> c >> d >> e >> f;
		printf("%.6f %.6f\n", (c * e - b * f) / (double)(a * e - b * d), (c * d - a * f) / (double)(b * d - a * e));
	}
}

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

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<string>
using namespace std;
/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	double a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 0
	while (cnt < 2) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		int dummy_x = x_vector[i] * 1000;
		int dummy_y = y_vector[i] * 1000;

		//x?????????????°???°????¬¬4???????????¨?????\
		if (5 <= (x_vector[i] * 10000 - dummy_x * 10)) {
			x_vector[i] += 0.001;
		}

		//y?????????????°???°????¬¬4???????????¨?????\
		if (5 <= (y_vector[i] * 10000 - dummy_y * 10)) {
			y_vector[i] += 0.001;
		}

		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::setprecision(3) << y_vector[i] << endl;
		//???????????°
		//std::cout << std::setprecision(3) << x_vector[i] * 10000 << " ";
		//std::cout << std::setprecision(3) << y_vector[i] * 10000 << endl;
		//end???????????°
	}

	//???????????°
	//while (1);

	return 0;
}