Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE == 0 {
			bE = 1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		fmt.Print(x)
		fmt.Println(".000")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

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

int main() {
	int cnt = 0;
	int a[200], b[200], c[200], d[200], e[200], f[200];
	double x[200], y[200];

	while(cin >> a[cnt] >> b[cnt] >> c[cnt] >> d[cnt] >> e[cnt] >> f[cnt]) cnt++;

	for(int i=0; i<cnt; i++) {
		if(a[i] != 0 && b[i] != 0 && d[i] != 0 && e[i] != 0) {
			x[i] = (b[i]*f[i]-e[i]*c[i])/(b[i]*d[i]-a[i]*e[i]);
			y[i] = (d[i]*c[i]-a[i]*f[i])/(b[i]*d[i]-a[i]*e[i]);
		} else {
			if(a[i] == 0) {
				y[i] = c[i]/b[i];
				x[i] = (f[i]-e[i]*y[i])/d[i];
			} else if(b[i] == 0) {
				x[i] = c[i]/a[i];
				y[i] = (f[i]-d[i]*x[i])/e[i];
			} else if(d[i] == 0) {
				y[i] = f[i]/e[i];
				x[i] = (c[i]-b[i]*y[i])/a[i];
			} else if(e[i] == 0) {
				x[i] = f[i]/d[i];
				y[i] = (c[i]-a[i]*x[i])/b[i];
			}
		}
	}

	for(int i=0; i<cnt; i++) cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl;

	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  double a,b,c,d,e,f;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    double x=(c*e-b*f)/(a*e-b*d);
    double y=(f-d*x)/e;
    if(x==0)x=0;
    if(y==0)y=0;
    printf("%.5f %.5f\n",x,y);
  }
}

    
    /*
      ey=f-dx
      y=(f-dx)/e
      ax+b(f-dx)/e=c
      aex+df-bdx=ce
      (ae-bd)x=ce-df
      x=(ce-df)/(ae-bd)

  y=(f-dx)/e
  y=(f



a b  x  c
d e  y  f

x  c  e -b
y  f  -d a  /(ae-bd)*/

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

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

using namespace std;

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

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<functional>
#include<queue>
#include<math.h>
#define INF 999999

using namespace std;


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

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

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

	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/10));
	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){
		if(a!=0.0){
		  y=(f-c*d/a)/(e-b*d/a);
		  x=(c-b*y)/a;
		}
		else if(d!=0.0 && b!=0.0){
		  y=c/b;
		  x=(f-e*y)/d;
		}
		else if(d==0.0){
		  x=0.0;
		  if(b!=0.0) y=c/b;
		  else if(e!=0.0) y=f/e;
		}

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

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

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

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <sstream>

using namespace std;

using DataSet = vector<double>;


void readInputData(vector<string>& input_data){
    string buff;
    while(getline(cin, buff)){
        input_data.push_back(buff);
    }
}

void _parseString(const string& input_data, DataSet& data_set) {
    data_set.resize(6);

    stringstream ss;
    ss << input_data;
    ss >> data_set[0] >> data_set[1] >> data_set[2]
        >> data_set[3] >> data_set[4] >> data_set[5];
}

void parseString(const vector<string>& input_data, vector<DataSet>& data_set) {
    data_set.resize(input_data.size());
    for(int i = 0; i < input_data.size(); ++i) {
        DataSet buff;
        _parseString(input_data[i], buff);
        data_set[i] = buff;
    }
}

double determinant2d(const DataSet& data){
    return data[0] * data[4] - data[1] * data[3];
}

void inverse2d(DataSet& data){
    double t = data[0];
    data[0] = data[4];
    data[4] = t;

    data[1] = -data[1];
    data[3] = -data[3];
}


void calculateXY(const DataSet& data, double det, vector<double>& result){
    result.resize(2);

    result[0] = (data[0] * data[2] + data[1] * data[5]) / det;
    result[1] = (data[3] * data[2] + data[4] * data[5]) / det;
}

void solve(vector<DataSet>& data_set){
    cout << fixed;
    cout << setprecision(3);

    for(int i = 0; i < data_set.size(); ++i){
        vector<double> buff;

        double det = determinant2d(data_set[i]);

        inverse2d(data_set[i]);

        calculateXY(data_set[i], det, buff);

        cout << buff[0] << " " << buff[1] << endl;
    }
}




void doAllProcess(){
    vector<string> input_data;
    readInputData(input_data);

    vector<DataSet> data_set;
    parseString(input_data, data_set);

    solve(data_set);
}


}

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

C++: #include<stdio.h>
#include<math.h>
int main(void){
    double a,b,c,d,e,f,A,x,y,X,Y,Z;

    while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
    A=a;
    a=a*d,b=b*d,c=c*d;
    d=d*A,e=e*A,f=f*A;

    Y=b-e,Z=c-f;
    y=Z/Y;
    x=(c-y*b)/a;
    x=x+0.0004,y=y+0.0004;
    x=x*1000,y=y*1000;
    x=floor(x);
    y=floor(y);
    x=x/1000,y=y/1000;

   printf("%.3lf %.3lf\n",x,y);
    }
   // printf("\na%lf\nb%lf\nc%lf\nd%lf\ne%lf\nf%lf\n%lf\n%lf",a,b,c,d,e,f,Y,Z);


    }

C++: #include<stdio.h>
int main(){
	int a,b,c,d,e,f;
	double x,y,z,v;
	while(1){
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	x=(double)(c*e-b*f)/(a*e-b*d);
	y=(double)(c*d-a*f)/(b*d-a*e);
	if(x>=-0.0005&&x<0.0005)	x=0;
	if(y>=-0.0005&&y<0.0005)	y=0;
	printf("%.3lf %.3lf\n",x,y);
}
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
 double a,b,c,d,e,f,y,x;
 int i=0,n;
while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){
  y=((c*d)-(a*f))/((b*d)-(a*e));
  x=((c*e)-(b*f))/((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>
#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 <iostream>
using namespace std;
 
int main() {
	double  a,b,c,d,e,f,x,y;
	while(cin >> a>>b>>c>>d>>e>>f){
		x = (c*e-f*b)/(a*e-d*b);
		y = (a*f-d*c)/(a*e-d*b);
		printf("%.3f %.3f\n",x,y);
	}
}