Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var strs []string
	var a, b, c, d, e, f float64
	var x, y float64
	for scanner.Scan() {
		strs = strings.Split(scanner.Text(), " ")
		_a, _ := strconv.Atoi(strs[0])
		_b, _ := strconv.Atoi(strs[1])
		_c, _ := strconv.Atoi(strs[2])
		_d, _ := strconv.Atoi(strs[3])
		_e, _ := strconv.Atoi(strs[4])
		_f, _ := strconv.Atoi(strs[5])
		a = float64(_a)
		b = float64(_b)
		c = float64(_c)
		d = float64(_d)
		e = float64(_e)
		f = float64(_f)
		y = (c*d - f*a) / (d*b - a*e)
		x = (c - b*y) / a

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

C++: #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
#include <limits>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ld long double
ld a, b, c, d, e, f, x, y;
ld shish(ld a)
{
	a *= 1000;
	a += 0.51;
	a = (ld)((int)a);
	a /= 1000;
	cout << a << endl;
	return a;
}
int main() {
	while (cin >> a >> b >> c >> d >> e >> f) {
		y = (a*f - c*d) / (ld)(a*e - b*d);
		x = (c*e - f*b) / (ld)(a*e - b*d);
		x = shish(x);
		y = shish(y);
		cout << fixed << setprecision(15) << x ;
		cout << " ";
		cout << fixed << setprecision(15) << y<< endl;
	}
	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;

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

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

		cout << fixed << setprecision(3) << x + 0 << " " << y + 0 << endl;

	}
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
  double a,b,c,d,e,f;
  double A,B,C;
  double temp;
  int cnt;
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){
    A = a;
    B = b;
    C = c;
    b /= a;
    c /= a;
    a = 1;
    e /= d;
    f /= d;
    d = 1;
    b -= e;
    c -= f;
    c /= b;
    C -= c * B;
    C /= A;
    printf("%.3f %.3f\n",C,c);
  }
  return(0);
}

C++: #include <stdio.h>

//ax + by = c
//dx + ey = d

//y = (af-cd)/(ae-bd)
//x = (c-by)/a

int main(void){
double a,b,c,d,e,f;
while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f))
{
printf("%.3f %.3f\n", (c-b*((a*f-c*d)/(a*e-b*d)))/a, ((a*f-c*d)/(a*e-b*d)));
}
return 0;
}

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


using namespace std;

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

C++: #include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main(){
	double a,b,c,d,e,f;
	double x,y;
	while(cin >> a >> b >> c >> d >> e >> f){
	//	ax+by=c > y=(c-ax)/b
	// 	dx+ey=f > y=(f-dx)/e
	//	> (c-ax)/b=(f-dx)/e
	//	c/b-(a/b)x=f/e-(d/e)
	// 	(d/e)x-(a/b)x=f/e-c/b
		double tmp=(d/e)-(a/b);
		x=((f/e)-(c/b))/tmp;
		y=(c-(a*x))/b;
		printf("%.3lf %.3lf\n", x , y );
	}
}

C++: #include<bits/stdc++.h>
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>

using namespace std;
#define EPS 1e-9
#define MAX 505
#define pb push_back
#define mp make_pair
#define ins insert
#define fi first
#define se second
#define pi acos(-1.0)
#define mod 100000007
#define inf 2147483647
#define ll long long int
#define sss stringstream
#define oss ostringstream
#define iss istringstream
#define llu long long unsigned

#define _sq(a) (a)*(a)
#define sz(a) ((int)a.size())
#define gcd(a,b)    __gcd(a,b)
#define lcm(a,b) ((a)*((b)/gcd(a,b)))
#define _max3(a,b,c) max(a, max(b,c))
#define _min3(a,b,c) min(a, min(b,c))
#define FOR(i, n) for(i=0; i<(int)n; i++)
#define FOR1(i, n) for(i=1; i<=(int)n; i++)
#define mem(a) memset(a, 0, sizeof(a))
#define _set(a) memset(a,-1,sizeof(a))
#define FORI(i, a, b) for(i=a; i>=(int)b; i--)
#define FORab(i, a, b) for(i=a; i<=(int)b; i++)
#define popcount(n) __builtin_popcount(n)
#define popcountl(n) __builtin_popcountll(n)
#define sort_rev(a) sort(a.rbegin(), a.rend())
#define sort_all(a) sort(a.begin(), a.end())
#define dis_twopoints(x1,y1,x2,y2) sqrt(_sq(x1-x2) + _sq(y1-y2))
#define foreach(i,n) for(__typeof((n).begin())i =(n).begin();i!=(n).end();i++)

//If Long Long (mask & (1LL << k))
#define check(mask, k) (mask & (1 << k))
#define set1(mask, k) (mask | (1 << k))
#define set0(mask ,k) (mask & (~(1<<k)))

#define SD(a) scanf("%d",&a)
#define SLF(a) scanf("%lf",&a)
#define SC(a) scanf("%c",&a)
#define SS(a) scanf("%s",a)
#define SLLD(a) scanf("%lld", &a)
#define Si64(a) scanf("%I64d", &a)

#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)
int main()
{
    double a,b,c,d,e,f,x,y,fl,clx,cly;
    while((cin>>a>>b>>c>>d>>e>>f)!=EOF)
    {
        fl=(e*a-b*d);
        clx=c*e-b*f;
        if(clx==0)
            x=0.0;
        else
            x=clx/fl;
        cly=f*a-c*d;
        if(cly==0)
            y=0.0;
        else
            y=cly/fl;
        printf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <stdio.h>
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 n[6];
	int s;
	int i=0;
	while (cin >> s){
		if (i == 5){
			n[i]=s;
			/* for (int j=0;j<=5;j++)
			{
				cout << "n[" << j << "]=" << n[j] << endl;
			}*/
			double* an;
			an = solve_equations(n);
			/* printf("%.3lf",*(an+0));
			cout << " " << endl;
			printf("%.3lf",*(an+1)); */
			if (an[1] == 0)
				cout << fixed << setprecision(3) << an[0] << " " << 0.000 << endl;
			else if(an[0] == 0)
				cout << fixed << setprecision(3) << 0.000 << " " << an[1] << endl;
			else
				cout << fixed << setprecision(3) << an[0] << " " << an[1] << endl;

			i = 0;}
		else{
			n[i]=s;
			i++;
		}
	}
	return 0;
			// cout << l[0]  endl;
}

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

int main(){
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double det = a*e-b*d;
		double x = 1/det*(c*e - b*f);
		double y = 1/det*(-c*d + a*f);	
		if(x < 0.0000001) x = 0;
		if(y < 0.0000001) y = 0;

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