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<cmath>
#include<cstdio>
using namespace std;
int main(){
  double a,b,c,d,e,f;

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

C++: #include<stdio.h>
#include<iostream>
#include<iomanip>

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

void solver() {
    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        auto y = (c * d - f * a) / (b * d - a * e);
        auto x = (c * e - f * b) / (a * e - b * d);
        cout << fixed;
        cout << setprecision(3);
        cout << x << " " << y << endl;
    }
}

int main() {
    solver();
    return 0;
}

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

using namespace std;

typedef struct {
        double x1;
        double x2;
} answer;

answer solve_simultaneous_equations(double a, double b, double c, double d, double e, double f) {
        answer ans;
        ans.x1 = (c*e - b*f) / (a*e - b*d);
        ans.x2 = (c*d - a*f) / (b*d - a*e);
        return ans;
}

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

        while(cin >> a >> b >> c >> d >> e >> f) {
                answer ans;
                ans = solve_simultaneous_equations(a,b,c,d,e,f);
                cout << showpoint << fixed << setprecision(3) << ans.x1;
                cout << " ";
                cout << showpoint << fixed << setprecision(3) << ans.x2;
                cout << endl;
        }

        return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double a[2][3];
  while(cin>>a[0][0]>>a[0][1]>>a[0][2]>>a[1][0]>>a[1][1]>>a[1][2]){
    for(int i=0;i<2;i++){
      for(int j=i+1;j<3;j++)
	a[i][j]/=a[i][i];
      a[i][i]=1;
      for(int j=0;j<2;j++){
	if(j==i)continue;
	double t=a[j][i];
	for(int k=i;k<3;k++)
	  a[j][k]-=t*a[i][k];
      }
    }
    printf("%f %f\n",a[0][2],a[1][2]);
  }
  return 0;
}

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>
using namespace std;

int main(){

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

    return 0;
}

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

int main()
{
	std::vector<int> x, y;
	int a, b, c, d, p, q;
	while (scanf("%d %d %d %d %d %d", &a, &b, &p, &c, &d, &q) != EOF)
	{
		x.push_back(d*p - b*q / (a*d - b*c));
		y.push_back(p*c - a*q / (b*c - a*d));
	}

	for (int i = 0; i < x.size(); ++i)
		std::cout << x[i] << " " << y[i] << std::endl;
	return 0;
}

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

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

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


int main(void) {
    double 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 = (c*d - a*f) / (b*d - a*e);
        
        printf("%.3lf %.3lf", x, y);
        cout << endl;
    }
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double gcd( double m, double n );
double lcm( double m, double n );
int main(int argc, const char * argv[])
{
    double a=0.0;
    double b=0.0;
    double c=0.0;
    double d=0.0;
    double e=0.0;
    double f=0.0;
    double x=0.0;
    double y=0.0;
    int end=0;
    
    while(end!=EOF){
        a=end;
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        double ad = lcm( a,d );
        printf("%lf\n",ad);
        
        double a2 = ad/a;
        double b2 = b*a2;
        double c2 = c*a2;
        
        double d2 = ad/d;
        double e2 = e*d2;
        double f2 = f*d2;
        
        y = (c2-f2)/(b2-e2);
        x = (c-b*y)/a;
        
        printf("%.3lf",x);
        printf(" ");
        printf("%.3lf\n",y);
        
    }
    
}
double gcd( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

double lcm( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n);
}

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

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

	while(cin >> a >> b >> c >> d >> e >> f){
	printf("%.3f %.3f\n", (c*e-b*f)/(a*e-b*d),(a*f-c*d)/(a*e-b*d));
}
	return 0;
}

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

int main(void){
    int a,b,c,d,e,f;
    double ansX,ansY;
    while(std::cin >> a >> b >> c >> d >> e >> f){
        ansX = (c*e - b*f) / (a*e - b*d);
        ansX *= 1000;
        if(ansX > 0) 
            ansX += 0.5;
        else 
            ansX -= 0.5;
        ansX = int(ansX);
        ansX /= 1000;
        
        ansY = (a*f - c*d) / (a*e - b*d);
        ansY *= 1000;
        if(ansY > 0) 
            ansY += 0.5;
        else
            ansY -= 0.5;
        ansY = int(ansY);
        ansY /= 1000;
        
        std::cout <<fixed << setprecision(3) << ansX << " " << fixed << setprecision(3)<<ansY << std::endl;
    }
}

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

C++: #include <stdio.h>
#include <math.h>
 
using namespace std;
 
 
int main(){
    double a,b,c,d,e,f,x,y;
 
    while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
        x=(c*e-b*f)/(a*e-d*b);
        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>
using namespace std;
void sort(int &a, int &b, int &c);

int main() {
	int a,b,c,d,p,q;
	while(cin>>a>>b>>p>>c>>d>>q) {
		double x=(d*p-b*q)/(d*a-b*c);
		x+=0.0005;
		double y=(c*p-a*q)/(c*b-a*d);
		y+=0.0005;

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