Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

C++: #include <conio.h>
#include <iostream>
#include <iomanip>
#include <math.h>
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);
		
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	}
        cin.get();
        getch();
	return 0;
}

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

using namespace std;

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

C++: #include<stdio.h>
int main(void)
{
	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)(c*e-b*f)/(a*e-b*d);
		y=(double)(c*d-a*f)/(b*d-a*e);
		if(x==0){
			x=0;
			printf("%0.3f %0.3f\n",x,y);	
		}
		else{
			printf("%0.3f %0.3f\n",x,y);
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define Vi vector<int>
#define FOR(i,s,e) for (int i=s; i<e; i++)
#define ITER(v) v.begin(), v.end()

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

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

    while (true) {
        cin >> a >> b >> c >> d >> e >> f;
        if (cin.eof()) { break; }
        den =  a * e - b * d;
        x = static_cast<double>(c * e - b * f) / den;
        y = static_cast<double>(- c * d + a * f) / den;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }

    return 0;
}

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

int main(void){
	int a,b,c,d,e,f;
	double x,y;

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

	return 0;

}

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

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		X= round(X*1000)/1000;
		Y= round(Y*1000)/1000;

		if(Y>-0.0005 && Y<=0.0){
			Y=0;
		}

		if(X>-0.0005 && X<=0.0){
			X=0;
		}

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}

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

string toStr(int n);
string intToToStr(int n);

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

  while(cin >> a >> b >> c >> d >> e >> f) {
    a = a * 10000;
    b = b * 10000;
    c = c * 10000;
    d = d * 10000;
    e = e * 10000;
    f = f * 10000;
    
    int x, y;
    int det = a * e - b * d;

    x = ( e * c - b * f) / det;
    y = (-d * c + a * f) / det;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  int ipart = n / 10000;
  int fpart = (n - ipart * 10000) + 5;
  return intToString(ipart) + "." + intToString(fpart).substr(0, 3);
}

string intToString(int n) {
  string stream ss;
  ss << n;
  return ss.str;
}

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

using namespace std;

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

C++: #include <stdio.h>
#include<string>
#include<string.h>
#include <math.h>
#include<iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace  std;


/*
//my header
#include "define.h"
#include "geometry.h"*/

#define MyAbs(a) ((a)>0?(a):-(a))
#define MyEqualDoule(a,b) (MyAbs(a-b)<1e-6)

void init()
{
#ifdef _WIN32
	freopen("1.txt", "r", stdin);
#endif
}

void func();

int main()
{
	init();
	func();

	return 0;
}


void func()
{
	int a,b,c,d,e,f;
	float x, y;
	while(~scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f))
	{
			x = (c*e-f*b)*1.0/(a*e - b*d);
			y = (c*d-a*f)*1.0/(b*d - a*e);
			float x2 = (c-b*y)*1.0/a;
			if(!MyEqualDoule(x-x2, 0))
				while(1);
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include <cstdio>
#include <cmath>

using namespace std;

static const double EPS=1e-8;

int main() {
    while (true) {
        double a, b, c, d, e, f;
        if (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) == EOF)
            break;

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

        if (abs(x) < EPS) x = 0;
        if (abs(y) < EPS) y = 0;

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

    return 0;
}

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

#define MAX 256

int main(void){

	double a, b, c, d, e, f;
	double ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%f%f%f%f%f%f%f", &a,&b,&c,&d,&e,&f) != EOF){
		if (a*e != b*d){
			ansx[i] = (c*e - b*f) / (a*e - b*d);
			ansy[i] = (c*d - a*f) / (b*d - a*e);
		}
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3f %.3f\n", ansx[j], ansy[j]);
	}

	return 0;
}

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

int rnd(double t){
	if(t>=0.0){
		return (int)(t+0.5);
	}else{
		return (int)(t-0.5);
	}
}
void prnt(double t){
	if(t<0.0){
		cout<<"-";
		t*=-1;
	}
	cout<<(int)t<<"."<<(int)(t*10)-(int)t*10<<(int)(t*100)-(int)(t*10)*10<<(int)(t*1000)-(int)(t*100)*10;
}
int main(){
	double a,b,c,d,e,f,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);
		cout<<x<<" "<<y<<endl;
		x=rnd(x*1000.0)/1000.0;
		y=rnd(y*1000.0)/1000.0;
		cout<<x<<" "<<y<<endl;
		prnt(x);
		cout<<" ";
		prnt(y);
		cout<<endl;
	}
	return 0;
}

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

int main(){
	double a, b, c, d, e, f, A, B, C, x, y;
	int xx, yy;

	while(cin >> a >> b >> c >> d >> e >> f){
		A = a * e - b * d;
		B = c * e - b * f;
		C = c * d - a * f;

		x = B / A + 0.0005;
		y = (-1) * C / A + 0.0005;
		xx = x * 1000;
		yy = y * 1000;
		x = xx * 0.001;
		y = yy * 0.001;
		printf("%.3f %.3f?\n", x, y);
	}
	return 0;
}

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

int main()
{
	
	// 係数行列
	double A[2][2];
	
	// 定数ベクトル
	double  B[2];
	
	// 解ベクトル
	double x[2];
	
	
	double a, b, c, d, e, f;
	// 入力の最後まで処理する
	while(cin >> a >> b >> c >> d >> e >> f){
	A[0][0] = a;
	A[0][1] = b;
	A[1][0] = d;
	A[1][1] = e;
	
	B[0] = c;
	B[1] = f;
	
	
	
	int i,j,k;
	double tmp;
	
	// 前進消去
	for(i=0;i<1;i++){
		for(j=i+1;j<2;j++){
			for(k=i+1;k<2;k++){
				A[j][k] = A[j][k] - (A[j][i]/A[i][i])*A[i][k];
			}
			B[j] = B[j] - (A[j][i]/A[i][i])*B[i];
		}
	}
	
	// 後退代入
	for(i=1;i>=0;i--){
		tmp = B[i];
		for(j=i+1;j<2;j++){
			tmp = tmp - A[i][j]*x[j];
		}
		x[i] = tmp/A[i][i];
	}
	
	printf("%.3f %.3f\n", x[0], x[1]);
	
	}
	
	return 0;
}