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 <iostream>

int main()
{
        int a, b, c, d, e, f;
        double y;
        std::cout.precision(3);
        std::cout.setf(std::ios::fixed);
        while(std::cin >> a >> b >> c >> d >> e >> f)
        {
                if(a != 0)
                {
                        y = (f - d*c/(double)a)/(e - d*b/(double)a);
                        std::cout << (c - b*y)/a << " " << y << std::endl;
                }
                else
                {
                        y = c/(double)b;
                        std::cout << (f - e*y)/d << " " << y << std::endl;
                }
        }
        return 0;
}

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f,bb,cc,ee,ff,x,y;
	for(;;){
		if(scanf("%lf",&a)==EOF){break;}
		scanf("%lf",&b);
		scanf("%lf",&c);
		scanf("%lf",&d);
		scanf("%lf",&e);
		scanf("%lf",&f);
		bb=b*d;
		cc=c*d;
		ee=e*a;
		ff=f*a;
		y=(cc-ff)/(bb-ee);
		x=(c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

C++: /*************************************************************************
	> File Name: 23.cpp
	> Author: ralph
	> Mail: 1694487365@qq.com
	> Created Time: 2018年12月21日 星期五 21时32分48秒
 ************************************************************************/

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,c,d,e,f;
    while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF)
    {
        double ans1=(c*e-b*f)/(a*e-b*d),ans2=(a*f-c*d)/(a*e-b*d);
        printf("%.3f %.3f\n",ans1==0?0:ans1,ans2==0?0:ans2);
    }
}

C++: #include <iostream> 
#include <string> 
#include <vector> 
#include <cmath> 
#include <algorithm> 
#include <cstdlib> 
#include <ctime> 
#include <cstdio> 
#include <functional> 
#include <set> 
#include <sstream> 
#include <cctype>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
 
using namespace std; 

const long long INF=1LL<<50LL;
const double PI=3.14159265358979323846264;
const double eps=1e-8;
typedef vector<double> vec;
typedef vector<vec> mat;

vec gauss_jordan(const mat &A, const vec &b){
	int n=A.size(); //??£??????????????????
	mat B(n,vec(n+1));
	
	//?????§??????
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++) B[i][j]=A[i][j];
	}
	for(int i=0;i<n;i++) B[i][n]=b[i];
	
	for(int i=0;i<n;i++){
		int pivot=i;
		for(int j=i;j<n;j++){
			if(abs(B[j][i]) > abs(B[pivot][i])) pivot=j;
		}
		
		swap(B[i],B[pivot]);
		if(abs(B[i][i]) < eps) return vec();
		
		for(int j=i+1;j<=n;j++) B[i][j]/=B[i][i];
		for(int j=0;j<n;j++){
			if(i!=j){
				for(int k=i+1;k<=n;k++) B[j][k]-=B[j][i]*B[i][k];
			}
		} 
	}
	
	vec x(n);
	for(int i=0;i<n;i++) x[i]=B[i][n];
	return x;
	
}



int main(){

	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		
		mat A(2,vec(2));
		vec v(2);
		
		A[0][0]=a; A[0][1]=b;
		A[1][0]=d; A[1][1]=e;
		v[0]=c; v[1]=f;
		
		vec ans=gauss_jordan(A,v);
		printf("%.3f %.3f\n",ans[0],ans[1]);	
	}

	return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);++i)

int main() {
  for(;;) {
    double a, b, c, d, e, f;
    if( !(cin >> a >> b >> c >> d >> e >> f) )break;
    double det = 1.0 / (a * e -b * d);
    double x = det * (e * c - b * f);
    double y = det * (-d * c + a * f);
    double EPS = 1e-8;
    char buf[128];
    sprintf(buf, "%.4f", x + EPS);
    buf[ strlen(buf) - 1 ] = ' ';
    printf(buf);
    sprintf(buf, "%.4f", y + EPS);
    buf[ strlen(buf) - 1 ] = '\n';
    printf(buf);
  }
  return 0;
}

C++: 
#include <cmath>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>

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

    while (getline(std::cin, str)) {
        std::istringstream str_s(str);

        str_s >> a >> b >> c >> d >> e >> f;

        if (c*e - b*f == 0) 
            x = 0;
        else
            x = (c*e - b*f) / (a*e - b*d);

        if (c*d - a*f == 0)
            y = 0;
        else
            y = (c*d - a*f) / (b*d - a*e);

        x = (double)round(x*1000)/1000;
        y = (double)round(y*1000)/1000;

        std::cout.setf(std::ios::fixed);  
        std::cout.precision(3);

        std::cout << std::showpoint << x << ' ' << y << '\n';
    }

    return 0;
}

C++: #include <iostream>
#include <iomanip>
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);

		if(static_cast<int>(Y*100000)%100>=49 && static_cast<int>(Y*100000)%100<=50 && Y<0){
			Y += 0.0001;
		}

		if(static_cast<int>(-1*X*100000)%100>=49 && static_cast<int>(-1*X*100000)%100<=50 && X<0){
			X += 0.0001;
		}

		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<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<string>
using namespace std;

double deter(double a, double b, double c, double d) {
	return a * d - b * c;
}

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

	double det;

	
	while (cin >> a >> b >> c >> d >> e >> f){

		det = deter(a, b, d, e);

		printf("%.3lf ", deter(c, b, f, e) / det);
		printf("%.3lf\n", deter(a, c, d, f) / det);



		
	}

	//system("pause");
	return 0;
}

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

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if ( cin.eof() )
			break;

		double delta = 1.0 / ( a*e - b*d );

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

		if ( x == 0.0 )
			x = 0.0;
		if ( y == 0.0 )
			y = 0.0;

		cout << setprecision(3) << setiosflags(ios::fixed) << x << " " << y << endl;

	}

	return 0;
}

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

int main() {
	//ax + by = c
	//dx + ey = f

	int A, B, C, D, E ,F = 0;
	cin >> A >> B >> C >> D >> E >> F;

	int COMMON_A = D;
	int COMMON_B = A;
	
	A *= COMMON_A;
	B *= COMMON_A;
	C *= COMMON_A;
	D *= COMMON_B;
	E *= COMMON_B;
	F *= COMMON_B;

	int X,Y;
	Y = (E-B);
	if((F-C) == 0 && (E-B) < 0)
		Y = -Y;
	float y = (F-C) / (E-B);

	X = (C-B*y);

	float x;
	x = (C- B * y) / A;
	if (X == 0 && A < 0)
		x = -x;

	printf("%0.3f %0.3f\n",x,y);

	return 0;
}