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
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

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;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double a,b,c,d,e,f,a2,b2,c2,ansx,ansy; // ax+by=c  dx+ey=f
  while(cin >> a >> b >> c >> d >> e >> f){
    a2=a;
    b2=b;
    c2=c;

    a/=b; // (a/b)x+y=c
    c/=b; // (a/b)x+y=(c/b)
    a*=(-1); // y=(c/b)-(a/b)x
    c*=e; // dx+e(c)=f
    a*=e; // dx+e(c+ax)=f
    a+=d; // dx+(a*e)x+(c*e)=f
    f-=c; // dx+(a*e)x=f-(c*e)
    ansx=f/a;
    if(ansx > -0.0005 && ansx <= 0){
      printf("0.000 ");
    } else{
      printf("%.3f ",ansx);
    }
 
    a2*=ansx;
    c2-=a2;
    ansy=c2/b2;
    if(ansy >= -0.0005 && ansy <= 0){
      printf("0.000\n");
    } else{
      printf("%.3f\n",ansy);
    }
  }
  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){
			swap(a,d);
			swap(b,e);
			swap(c,f);
		}
		b /= a;
		c /= a;
		a = 1;
		if(d != 0){
			e -= b*d;
			f -= c*d;
			d = 0;
		}
		f /= e;
		e = 1;
		c -= b*f;
		b = 0;
		printf("%.3f %.3f\n",c,f);
	}
}

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

int main(){
	
	double a,b,c,d,e,f ;
	double x,y ;
	
	while(1){
		cin >> a ;
		if( cin.eof() ) break ;
		cin >> b >> c ;
		cin >> d >> e >> f ;
		
		if( a*e - b*d == 0 ){
			cout << "error" << endl ;
		}
		else{
			x = ( c*e - b*f ) / ( a*e - b*d ) + 0.00005 ;
			y = ( a*f - d*c ) / ( a*e - b*d ) + 0.00005 ;
		}
		
		printf("%.3lf %.3lf\n",x ,y) ;
	}
	
return 0 ;
}

/*
ax + by = c
dx + ey = f
*/

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  double a,b,c,d,e,f;
  while(cin>>a>>b>>c>>d>>e>>f){
    double y=(a*f-c*d)/(a*e-b*d);
    double x=(c-b*y)/a;
    printf("%.3f %.3f\n",x,y);
  }
  

}

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


int main() {
	ios::sync_with_stdio(false);
	double a, b, c, d, e, f;
	
	cin >> a >> b >> c >> d >> e >> f;
	double x = (e*c-b*f)/(a*e-b*d);
	double y = (-c*d+a*f)/(a*e-b*d);
	cout << fixed << setprecision(3) << x << " " << y;
	
	while(cin >> a >> b >> c >> d >> e >> f){
		cout << "\n";
		double x = (e*c-b*f)/(a*e-b*d);
		double y = (-c*d+a*f)/(a*e-b*d);
                if(x==0) x=0;
                if(y==0) y=0;
		cout << fixed << setprecision(3) << x << " " << y;
	}

}