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 <cstdio>
#include <cmath>
using namespace std;

int main(void) {
    int a, b, c, d, e, f;
    float x, y;
    float det;
    while(cin >> a >> b >> c >> d >> e >> f) {
        det = a * e - b * d;
        x = (float)(e * c - b * f) / det;
        y = (float)(-d * c + a * f) / det;
        x = roundf(1000 * x) / 1000.0;
        y = roundf(1000 * y) / 1000.0;
        if(x == -0)
            x = 0.0;
        if(y == -0)
            y = 0.0;
        printf("%.3f %.3f\n", x, y);
    }
}

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

using namespace std;
int main() {
  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 * d - a * f) / (b * d - a * e);
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
}

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

C++: #include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = a; i >= (n); i--)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	double a, b, c, d, e, f, x, y;
  while(cin >> a >> b >> c >> d >> e >> f) {
    x = (c * e - b * f) / (a * e - b * d) + 0.0000;
    y = (c * d - a * f) / (b * d - a * e) + 0.0000;
    cout << fixed << setprecision(3) << x << " " << y << 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>>b>>c>>d>>e>>f){
    double y=(a*f-c*d)/(a*e-b*d);
    double x=(c-b*x)/a;
    printf("%.3f %.3f\n",x,y);
  }
  

}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  double a, b, c, d, e, f;
  while(cin >> a){
    cin >> b >> c >> d >> e >> f;
    double det = a * e - b * d;
    cout << (e * c - b * f) / det;
    cout << " ";
    cout << (- d * c + a * f) / det << endl;
  }
	return 0;
}

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

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

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	cout<<shosu(3);
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double tmp=a*e-b*d;
		double ansx=(c*e-b*f)/tmp;
		double ansy=(a*f-c*d)/tmp;
		if(ansx==-0) ansx=0;
		if(ansy==-0) ansy=0;
		cout<<ansx<<' '<<ansy<<endl;
	}
}

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

int main(){
	double a,b,c,d,e,f;
	double x,y;
	
	while(scanf("%lf %lf %lf %lf %lf %lf",&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 <stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

void print(double x, double y) {
    if (x == -0.0) x = 0;
    if (y == -0.0) y = 0;
    printf("%.3f %.3f\n", x, y);
}

int main() {
    double a, b, c, d, e, f;
    while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
        if (d == 0) {
            const double y = f / e;
            const double x = (c-b*y) / a;
            print(x, y);
        }
        else {
            const double y = (c-a*f/d) / (b-a*e/d);
            const double x = (f-e*y)/d;
            print(x, y);
        }
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	double a,b,c,d,e,f,n[20];
	while(cin>>a>>b>>c>>d>>e>>f){
	double x,y;
	int w;
	if(a == 0){
		n[0] = 0;
		n[1] = 0;
	}else{
		n[0] = c / a;
		n[1] = b / a;
	}
	if(d == 0){
		n[2] = 0;
		n[3] = 0;
	}else{
		n[2] = f / d;
		n[3] = e / d;
	}
	if(b == 0){
		n[4] = 0;
		n[5] = 0;
	}else{
		n[4] = c / b;
		n[5] = a / b;
	}
	if(e == 0){
		n[6] = 0;
		n[7] = 0;
	}else{
		n[6] = f / e;
		n[7] = d / e;
	}
	if(n[1] - n[3] == 0){
		y = 0;
	}else{
		y = (n[0] - n[2]) / (n[1] - n[3]);
	}
	if(n[5] - n[7] == 0){
		x = 0;
	}else{
		x = (n[4] - n[6]) / (n[5] - n[7]);
	}
	x = x * pow(10, - 5);
	double xx = x + 0.5;
	xx = xx * pow(10,5);
	y = y * pow(10, - 5);
	double yy = y + 0.5;
	yy = yy * pow(10,5);

	printf("%04f,%04f\n",&xx,&yy);



}
return 0;
}

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

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

  std::cin >> a;
  std::cin >> b;
  std::cin >> c;
  std::cin >> d;
  std::cin >> e;
  std::cin >> f;

  if(a >= d && fmodf(a, d) == 0) {
    y = (c - (f * (a / d))) / (b - (e * (a / d)));
    x = (c - (b * y)) / a;
  }
  else if(a < d && fmodf(d, a) == 0) {
    y = (f - (c * (d / a))) / (e - (b * (d / a)));
    x = (c - (b * y)) / a;
  }
  else if(b >= e && fmodf(b, e) == 0) {
    x = (c - (f * (b / e))) / (a - (d * (b / e)));
    y = (c - (a * x)) / b;
  }
  else if(b < e && fmodf(e, b) == 0) {
    x = (f - (c * (e / b))) / (d - (a * (e / b)));
    y = (c - (a * x)) / b;
  }
  else {}

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

  return 0;
}

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

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