Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

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]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

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

		bE := b - e
		cF := c - f
		y := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    if (b * e - e * b) {
      x = (c * e + f * b) / (a * e - d * b);
    } else {
      x = (c * e - f * b) / (a * e - d * b);
    }
    y = (c - a * x) / b;
    cout << x << ' ' << y << '\n';
  }
  return 0;
}

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

int main() {
  for(double a, b, c, d, e, f; scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF; ) {
    double det = a * e - b * d;
    double x = (e * c - b * f) / det;
    double y = (-d * c + a * f) / det;
    printf("%.4f %.4f\n", x + 1e-8, y + 1e-8);
  }
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>

using namespace std;



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

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

using namespace std;

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

C++: #include<cstdio>
using namespace std;
int main(void){
	int a,b,c,d,p,q;
	double x,y;
	while(scanf("%d%d%d%d%d%d",&a,&b,&p,&c,&d,&q)!=EOF){
		x=(double)(d*p-b*q)/(a*d-b*c);
		y=(double)(c*p-a*q)/(b*c-a*d);
		if(-0.001<x&&x<0.001)	x=0;
		if(-0.001<y&&y<0.001)	y=0;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

C++: #include <stdio.h>

int main(){
	int i,j;
	int a,b,c,d,e,f;
	int tmp;
	float x,y;
		
	while(scanf("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f)!=-1){
		tmp = d;
		d*=a; e*=a; f*=a;
		a*=tmp; b*=tmp; c*=tmp;
		y=(float)((c-f)/(b-e));
		x=(float)((c-b*y)/a);
		if(x==-0.000000){
			x = 0.000000;
		}
		if(y==-0.000000){
			y = 0.000000;
		}
		printf("%0.3f %0.3f\n",x,y);
	}
	
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#define EPS 1e-10
using namespace std;

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

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

int main()
{
    int a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        double l,m,n;
        l=a/d;
        m=b-e*l;
        n=c-f*l;
        y=n/m;
        x=(c-by)/a;
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

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

template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class itr, class func> void array_output(itr start, itr goal, func out = [](itr x) { return x; } ){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class itr, class func> void nint_output(itr start, itr goal, func out = [](itr x) { return x; } ){ string ans; for(auto i = start; i != goal; i++){ ans += string(out(*i)) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcount(n)

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

C++: 
#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int main(){
	double a,b,c,d,e,f,a1;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x,y,x1,y1;

		x=(f-e*y)/d;*/
		double det = a*e - b * d;
        double x = 1 / det * (c * e - b * f);
        double y = 1 / det * (f * a - c * d);
		if(x<0.001&&x>=0) x=0;
		if(y<0.001&&y>=0) y=0;
		if(x<-0.001) x=0;
		if(y<-0.001) y=0;
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include<iostream>
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-b*(c*d-a*f)/(b*d-a*e))/a; 
    y = (c*d-a*f)/(b*d-a*e);
    if(x == -0)x = 0;
    if(y == -0)y = 0;
    scanf("%3f %3f",&x,&y);
  }
}