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 <iomanip>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
    int a[3];
    int b[3];
    int y[3];
    int x[3];
    while(true) {
    REP(i,3)
        cin >> a[i];
    REP(i,3)
        cin >> b[i];
    if(!cin)
        return 0;
    double o[2];
        o[0] = b[1]*a[2] - a[1]*b[2];
        o[1] = -b[0]*a[2] + a[0]*b[2];
    REP(i,2)
        o[i] = (o[i]==0)?0:o[i]/(a[0]*b[1]-b[0]*a[1]);
    cout << fixed << setprecision(3) << o[0] << ' ';
    cout << fixed << setprecision(3) << o[1] << '\n';
    }
}

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

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

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004
#include <bits/stdc++.h>
using namespace std;

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

    cout<<fixed; // ?°???°?????\??????????????????????????????????????????????????°???????????°??????????????????
    cout<<setprecision(3)<<x<<" "<<y<<endl;
  }
  return EXIT_SUCCESS;
}

C++: ///
// File:  0004.cpp
// Author: ymiyamoto
//
// Created on Wed Nov  8 21:45:53 2017
//

#include <cstdint>
#include <iomanip>
#include <iostream>

using namespace std;

int32_t main()
{
  while (true) {
    double a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    if (cin.eof()) break;

    double x = (e * c - b * f) / (a * e - b * d);
    double y = (a * f - d * c) / (a * e - b * d);
    cout << fixed;
    cout << setprecision(3) << x + 0.0 << " " << y + 0.0 << endl;
  }

  return 0;
}

C++: #include <stdio.h>
main(){
 double x,y,a,b,c,d,e,f;
  while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) !=EOF){
    if(a!=0&&a*e!=0&&c/a-(b*f)/(a*e)!=0&&1-b*d/(a*e)!=0){
      x=(c/a-(b*f)/(a*e))/(1-b*d/(a*e));
      y=(f-d*x)/e;
    }
    else if(a==0){
      y=c/b;
      x=(f-e*y)/d;
    }
    else if(e==0){
      x=f/d;
      y=(c-a*x)/b;
    }
    else{    
      x=(f/d-(e*c)/(b*d))/(1-a*e/(b*d));
      y=(f-d*x)/e;
    }

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

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

int main(void){
    double a, b, c, d, e, f;
    
    cin >> a >> b >> c >> d >> e >> f;
    
    b = b / a;
    c = c / a;
    a = a / a;          //a = 1
    
    e = e - d*b;
    f = f - d*c;
    d = d - d*a;        //d = 0
    
    f = f / e;
    e = e / e;          //e = 1
    
    c = c - b*f;
    b = b - b*e;
    
    printf("%.3f %.3f",c , f);
}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	float x,y,goukei,g,g1,a,b,c,d,e,f,a1,b1,c1,d1,e1,f1;
	while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		g=a*d;
			a1=d*a;
			b1=d*b;
			c1=d*c;
			e1=a*e;
			d1=a*d;
			f1=a*f;
			y=b1-e1;
			goukei=c1-f1;
			y/=goukei;
			x=(c-b*y)/a;	
		printf("%.3f %.3f",x,y);
	}
	return 0;
}

C++: #include <stdio.h>

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

C++: // ------------------------------------
// Date:2018/ 2/13
// Problem:0004 : SimulataneousEquation 4.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

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

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

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

int main(){
	double a, b, c, d, e, f;
	while(std::cin >> a){
		std::cin >> b >> c >> d >> e >> f;
		std::cout << std::fixed << std::setprecision(3)
			<< floor((c * e - b * f) / (a * e - b * d) + 0.0005) << ' '
			<< floor((a * f - c * d) / (a * e - b * d) + 0.0005) << std::endl;
	}
	return 0;
}

C++: #include <cstdio>

int main(){
	int arr[10][10],p,q;
	float h[5];

	while(scanf("%d %d %d %d %d %d",&arr[1][1],&arr[1][2],&arr[1][3],&arr[2][1],&arr[2][2],&arr[2][3])!=EOF){
		//printf("%d %d %d %d %d %d \n",arr[1][1],arr[1][2],arr[1][3],arr[2][1],arr[2][2],arr[2][3]);
		if(arr[1][1] < 0){
			for(int k = 1;k<4;k++){
				arr[1][k] = arr[1][k]*(-1);
			}
		}

		if(arr[2][1] < 0){
			for(int l = 1;l<4;l++){
				arr[2][l] = arr[2][l]*(-1);
			}
		}

		for(int i = 4;i<7;i++){
			arr[1][i] = arr[1][i-3]*arr[2][1];
			arr[2][i] = arr[2][i-3]*arr[1][1];
		}

		p = arr[1][5]-arr[2][5];
		q = arr[1][6]-arr[2][6];

		h[2] = q/p;

		h[1] = (arr[1][3]-(arr[1][2]*h[2]))/arr[1][1];

		printf("%.3f %.3f\n", h[1],h[2]);
	}
}

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

/*
ax + by = c
dx + ey = f

x = (c-by)/a
d(c-by)/a + ey = f
dc/a - dby/a + ey = f
ey - dby/a = f - dc/a
y(e-db/a) = f - dc/a
y = (f-dc/a)/(e-db/a)

aex + bey = ce
bdx + bey = bf
aex - bdx = ce - bf
x(ae - bd) = ce - bf
x = (ce - bf)/(ae - bd)
by = c - ax
y = (c - ax)/b
*/
int main()
{
    while(true){
        double a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if(std::cin.eof()) break;
        double x, y;
        // if(b){
            x = (c*e - b*f) / (a*e - b*d);
            y = (c - a*x) / b;
        // }else{
        //     y = (f-d*c/a)/(e-d*b/a);
        //     x = (c-b*y)/a;
        // }
        if(x == -0) x = 0;
        if(y == -0) y = 0;
        std::cout << std::fixed << std::setprecision(3);
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}

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

int main()
{
    // your code goes here
    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f)
    {
        double x = (c * e - b * f) / (a * e - b * d);
        double y = (c - a * x) / b;
        if(x<-0.0001){
            x=0;
        }
        if(y<-0.0001){
            y=0;
        }
        printf("%.3lf %3lf\n", x, y);
    }
    return 0;
}

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

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

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