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>
#include <cmath>

template <typename T> double round(const T r, const int n = 0){
    if(r>=0){
        return floor(r + 5 * pow(10, n));
    }
    else{
        return ceil(r - 5 * pow(10, n));
    }
}

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)
			<< round((c * e - b * f) / (a * e - b * d), -3) << ' '
			<< round((a * f - c * d) / (a * e - b * d), -3) << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#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=(a*f-d*c)/(a*e-b*d);
		x=(c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

int main(void){
    int a,b,c,d,e,f;
    double ansX[1000],ansY[1000];
    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<iomanip>
#include<algorithm>
#include<cmath>

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

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

struct vector2{
	float x, y;
	vector2() : x(0), y(0){}
	vector2(float x, float y) : x(x), y(y){}
};

struct sim_elem{
	float a, b, c, d, e, f;
	sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){}
	sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){}
};

//	a / d * d
//	ey - by = f - c
//	y / y = (f - c) / y

// ax = -by + c
// ax / a = -(by + c) / a

vector2 sim_equ(sim_elem elem){

	float dx = elem.a / elem.d * elem.d;
	float ey = elem.a / elem.d * elem.e;
	float f = elem.a / elem.d * elem.f;

	float y = ey - elem.b;
	float yr = f - elem.c;
	y = yr / y;

	float ax = -elem.b * y + elem.c;
	float x = ax / elem.a;

	return vector2(x, y);
}

//	sprintf
float placement4(float val){
	char ret[128];
	sprintf_s(ret, "%.3f", val);
	return (float)atof(ret);
}

int main(){

	sim_elem elem;
	while (cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f){

		vector2 ret;
		ret = sim_equ(elem);
		printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) );
	}

	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){     
	  cout<<fixed<<setprecision(4);
	  cout <<(e*c - b*f) / (a*e - b*d) << " " << (a*f - d*c) / (a*e - b*d) << endl;
	}
    return 0;
}

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a=a+10;
	a=float (int (a));
	a=a/10000;
	return a;

}
int main(){
	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=(c*e-b*f)/(a*e-b*d);
		y=(c*d-a*f)/(b*d-a*e);
		
		x=round3(x);
		y=round3(y);
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

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

int main(){
	double a[6];
	double x,y;
	while(true){
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];
		if(cin.eof())
			break;
			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		
		cout << setprecission(3) << x << " " <<setprecision(3) << y << endl;
	}
	return 0;
}

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

int gcd(int a,int b){
	if(a<b)b%=a;
	if(b==0)return a;
	int c=b;b=a%b;a=c;
	return gcd(a,b);
}

int lcm(int a,int b){
	int c=gcd(a,b);
	return c*(a/c)*(b/c);
}

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

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

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

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

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

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

		cout << fixed;
		cout << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f,t=0,n;
	double x[100]={0},y[100]={0};
	
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		x[t]=(c*e-b*f)/(a*e-b*d);
		y[t]=(d*c-a*f)/(b*d-a*e);
		t++;
	}

	for(n=0;n<t;n++)
	{
		printf("%.3f %.3f\n",x[n],y[n]);
	}
	return 0;
}

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

int main(){
 double x,y;
 double a,b,c,d,e,f;
 while(!cin.eof()){
   cin >> a >> b >> c >> d >> e >> f ;

   x = (b*f-e*c)/(b*d-a*e);
   y = (c-a*x)/b;
   
   printf("%.3f %.3f\n",x,y);

 }
}

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

using namespace std;

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

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

C++: #include <iostream>

using namespace std;

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

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

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

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

using namespace std;

int main(void){
    
    int i,j=0,k = 0,l=0,m = 0,n= 0;
    double a,b,c,d,e,f;
    double x1,x2;
    
    cin >> a >> b >> c;
    cin >> d >> e >> f;
    
    double gyouretusiki = (a*e - d*b);
    
    x1 = (c/a) - (b/gyouretusiki)*(f -((d*c)/a));
    
    x2 = ((a) /(gyouretusiki))*(f-((d*c)/a));
    
    REP(i,5)
    {
    x1 =x1*10;
    x2 = x2*10;
    }
    x1 += 0.5;
    x2 += 0.5;
    x1 = (int)x1;
    x2 = (int)x2;
    REP(i,5)
    {
        x1 =x1/10;
        x2 = x2/10;
    }
    
    printf("%.3f %.3f\n",x1,x2);
    return 0;
            
                  
                  
    
}