Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var strs []string
	var a, b, c, d, e, f float64
	var x, y float64
	for scanner.Scan() {
		strs = strings.Split(scanner.Text(), " ")
		_a, _ := strconv.Atoi(strs[0])
		_b, _ := strconv.Atoi(strs[1])
		_c, _ := strconv.Atoi(strs[2])
		_d, _ := strconv.Atoi(strs[3])
		_e, _ := strconv.Atoi(strs[4])
		_f, _ := strconv.Atoi(strs[5])
		a = float64(_a)
		b = float64(_b)
		c = float64(_c)
		d = float64(_d)
		e = float64(_e)
		f = float64(_f)
		y = (c*d - f*a) / (d*b - a*e)
		x = (c - b*y) / a

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.se2", "r", stdin);
	string str = "";

	while (getline (cin, str )){
		// ax + by = c
		// dx + ey = f
		int a, b, c, d, e, f;
		stringstream ss(str);
		ss >> a >> b >> c >> d >> e >> f;
		// [ a b ][x] = [c]
		// [ d e ][y]   [f]
		// [x] = [e -b][c]
		// [y]   [-d a][f]/D
		double x,y;
		double D = (double)(a*e - b*d);

		x = (double)(e*c - b*f)/D;
		y = (double)(-d*c + a*f)/D;
		if (fabs(x) < 1.0e-6){
			x = 0.0;
		} // end if
		if (fabs(y) < 1.0e-6){
			y = 0.0;
		} // end if
		cout.setf( ios::fixed ); 
		cout.precision(3);
		cout << x << ' ' << y << endl;
	} // end for

	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, y;
  x = ((b*f)/e -c)/((b*d)/e-a);
  y = ((a*f)/d -c)/((a*e)/d-b);
  if(y == 0)y = 0;
  if(x == 0)x = 0;
  cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}

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

#define MAX 256

int main(void){

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

	int i = 0;

	while (scanf("%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);
			if (((int)(ansx[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansx[i] += 0.001;
			}
			if (((int)(ansy[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansy[i] += 0.001;
			}
		}
		i++;
	}

	if (i == 0)printf("\n");

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

C++: #include <iostream>

int main()
{
    using namespace std;
    double a, b, c, d, e, f, x, y;
    cout.precision(3);
    cout << fixed << showpoint;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double coef1 = d/a;
        b *= coef1; c *= coef1;
        y = (c - f)/(b - e);
        x = (c - b*y)/a;
        cout << x << " " << y << endl;
    }
}

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

int main()
{
    for (double a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; )
        cout << fixed << setprecision(3)
            << (b*f - c*e)/(b*d - a*e)
            << " "
            << (a*f - c*d)/(a*e - b*d) << endl;

    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
double r(double x,int n){
  for(int i=0;i<n;i++) x *= 10;
  x = floor(x+0.5);
  for(int i=0;i<n;i++) x /= 10;
  return x;
}
using namespace std;
int main(){
  double a,b,c,d,e,f,x,y,dk;
  int n;
  while(cin>>a>>b>>c>>d>>e>>f){
    /*a *= d;
    b *= d;
    c *= d;//方程式にd倍
    dk = d;
    d *= (a/dk);
    e *= (a/dk);
    f *= (a/dk);//方程式にa倍
    y = (c-f)/(b-e);
    a /= d;
    b /= d;
    c /= d;//元の方程式
    d /= a;
    e /= a;
    f /= a;//元の方程式*/
    y = (c*d-a*f)/(b*d-a*e);
    x = (e*c-f*b)/(a*e-b*d);
    cout << fixed << setprecision(3) << r(x,3) << ' ' << r(y,4) << endl;
  }
  return 0;
}

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

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

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

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

  
    
    return 0;
    
    }

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

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	// a x + b y = c
	// d x + e y = f
	double a,b,c,d,e,f;
	
	
	// 複数のデータセットが与えられる(入力の最後まで処理)
	while(cin>>a>>b>>c>>d>>e>>f){
		
		// ad x + bd y = cd
		// ad x + ea y = af
		// (bd - ae) y = cd - af
		// y = (cd - af)/(bd - ae)
		const double y = int((c*d - a*f)/(b*d - a*e)*10000)/10000.0;
		
		// ae x + be y = ce
		// bd x + be y = bf
		// (ae - bd) x = ce -bf
		// x = (ce - bf)/(ae - bd)
		const double x = int((c*e - b*f)/(a*e - b*d)*10000)/10000.0;
		
		//各値は小数点以下第３位まで出力(小数点以下第４位を四捨五入)
		printf("%.3f %.3f\n",x,y);
	}
}

C++: #include<stdio.h>

void printFunc(int a,int b,int c,int d,int e,int f);

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


  while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)){
    printFunc(a,b,c,d,e,f);
  }
  
  return 0;
}

void printFunc(int a,int b,int c,int d,int e,int f){
  float ansX,ansY;
  if(b == 0 || e == 0){
    ansY = 0;
  }
  else{
    ansY = (float)(c*d - f*a)/(float)(b*d - e*a);
  }

  if(a == 0 || d == 0){
    ansX = 0;
  }
  else{
    ansX = (float)(c*e - f*b)/(float)(a*e - d*b);
  }

  if(ansX < 0.0005f){
    ansX = 0.0f;
  }
  if(ansY < 0.0005f){
    ansY = 0.0f;
  }

  printf("%.3f %.3f\n",ansX,ansY);
}

C++: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double x = (e * c - b * f) / (e * a - b * d);
        double y = (c - a * x) / b;
        if (x == 0) x = 0;
        if (y == 0) y = 0;
        cout << fixed << setprecision(3) << x << " " << y << "\n";
    }
}

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

using namespace std;

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

	while (cin >> a >> b >> c >> d >> e >> f)
	{
		odd = b / e;

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

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

	}


	return 0;
}

C++: #include <iostream>
#include <string>
#include <cstdlib>

double a, b, c, d, e, f;

bool get_input()
{
	return (std::cin >> a >> b >> c >> d >> e >> f);
}

void solve()
{
	double det = a * e - b * d;
	double x, y;

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

	std::cout.setf(std::ios::fixed, std::ios::floatfield);
	std::cout.precision(3);
	std::cout << x << ' ' << y << std::endl;
}


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