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>
using namespace std;

int main(){
	while(true){
		double a,b,c,d,e,f;
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.fail()) break;
		cout<<(c*e-b*f)/(a*e-b*d)<<" "<<(c*d-a*f)/(b*d-a*e)<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstdio>
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;
typedef long long ll;
int a, b, c, d, e, f;

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

C++: #include<iostream>
using namespace std;
int main() {
return 0;
}

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

void calc(std::vector<double> first, std::vector<double> second) {
    double div;

    div = second[0] / first[0];
    second[0] = 0;
    second[1] -= first[1] * div;
    second[2] -= first[2] * div;
    second[2] /= second[1];
    second[1] = 1;

    first[2] -= first[1] * second[2];
    first[1] = 0;
    first[2] /= first[0];
    first[0] = 1;

    std::cout << std::fixed << std::setprecision(3) << first[2] << " " << second[2] << std::endl;
    return;
}

int main(void) {
    std::vector<double> first(3, 0);
    std::vector<double> second(3, 0);
    while(std::cin >> first[0]) {
        for (int i = 1; i < 3; i++) {
            std::cin >> first[i];
        }
        for (int i = 0; i < 3; i++) {
            std::cin >> second[i];
        } 
        calc(first, second);
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f)
	{
		y=((d*c)-(a*f))/((b*d)-(a*e));
		x=(c-(b*y))/a;
		printf("%.3f",x);
		cout<<" ";
		printf("%.3f",y);
		cout<<endl;
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))

//repetition//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

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

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

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

int main(void) {
	using namespace std;
	double a, b, c, d, e, f;
	double x, y;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		y = (double)(f*a - d*c) / (e*a - d*b);
		x = (c - b*y) / a;
		cout << showpoint << fixed << setprecision(3)<< x << ' ' << y << endl;
	}

	return 0;
}

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

double* solve_equations(int *a)
{
	// クラメルの公式を用いる
	int data_size=sizeof(a[0]);
	/*cout << "data_size=" << data_size << endl;
	cout << "a=" << a << endl;
	cout << "*(a + data_size*1)=" << *(a + 1) << endl;
	cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */
	int z = *(a + 0) * *(a + 4) 
		  - *(a + 1) * *(a + 3);
	int x = *(a + 2) * *(a + 4)
		  -	*(a + 1) * *(a + 5);
	int y = *(a + 0) * *(a + 5)
		  - *(a + 2) * *(a + 3);  
	double ax,ay;
	/*cout << "x=" << x << endl;
	cout << "y=" << y << endl;*/
	ax = pow(z,-1)*x;
	ay = pow(z,-1)*y;
	
	/* cout << ax << endl;
	cout << ay << endl; */
	double ans[2] = {ax,ay};
	return ans;
}

int main()
{
	int *p;
	int a[6] = {1,2,3,4,5,6};
	/*
	p = solve_equations(a);
	cout << *p << *(p + 1) << endl;*/

	int n[6];
	while (cin){
		for (int i=0;i<=5;i++)
		{
			if(!(cin >> n[i]))
				break;
		}
		double *ans;
		ans = solve_equations(n);
		cout << setprecision(3) << ans[0] << ' '<< ans[1] << endl;
	}
			// cout << l[0]  endl;
}

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

C++: #include <iostream>
#include<string>
#include<math.h>
#include<stdio.h>
#include <algorithm>
using namespace std;
int main(void){
    // Here your code !

double a,b,c,d,e,f;
double x,y;
while(cin>>a>>b>>c>>d>>e>>f){
x=(double)((e*c-b*f)/(e*a-b*d));
y=(double)((d*c-a*f)/(d*b-a*e)); 

if(x==0)x=0;
if(y==0)y=0;
printf("%.3f %.3f\n",x,y);
}



return 0;
}

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

using namespace std;

/* ax + by = c
   dx + ey = f
   
   (x, y) = { (ce - bf) / (ae - bd), (af - cd) / (ae - bd) } */


void Equation2(int a, int b, int c, int d, int e, int f, double& x, double& y)
{
	x = (c * e - b * f) / (a * e - b * d);
	y = (a * f - c * d) / (a * e - b * d);
}

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

	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f)
	{
		Equation2(a, b, c, d, e, f, x, y);

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

	return 0;
}