Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

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

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

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

C++: #include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
using namespace std;
class SimultaneousEquation{ 
    public:
        void solve(int a,int b,int c,int d,int e,int f){ 
            double x,y;
            x=double(a*e-b*d)/(c*e-b*f);
            y=double(c*d-a*f)/(b*d-a*e);
            printf("%.3lf %.3lf\n",x,y);
            }
};
int main(){ 
    int a,b,c,d,e,f;
    SimultaneousEquation inst;
    while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)){
        inst.solve(a,b,c,d,e,f);
    }
}

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f;
	double x[200],y[200];
	int cor = 0;
	while(scanf("%lf",&a) != EOF){
		scanf("%lf%lf%lf%lf%lf",&b,&c,&d,&e,&f);
		double det;
		det = a*e-b*d;
		x[cor] = (e*c-b*f)/det;
		y[cor] = (-d*c+a*f)/det;
		cor++;
	}
	for(int i = 0;i < cor;i++){
		if(x[i] <= 0 && x[i] > -0.0005)
			x[i] = 0.0001;
		if(y[i] <= 0 && y[i] > -0.0005)
			y[i] = 0.0001;
		printf("%.3lf %.3lf\n",x[i],y[i]);
	}
	return 0;
}