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
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

C++: #include<iostream>
using namespce 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<cstdio>
#include<iomanip>
#include<vector>
using namespace std;
class SimultaneousEquation{ 
    public:
        void solve(int a,int b,int c,int d,int e,int f){ 
            double x,y;
            x=double(a*e-b*d)/(c*e-b*f);
            y=double(c*d-a*f)/(b*d-a*e);
            printf("%.3lf %.3lf\n",x,y);
            }
};
int main(){ 
    int a,b,c,d,e,f;
    while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)){
        SimultaneousEquation inst;
        inst.solve(a,b,c,d,e,f);
    }
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	long double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		c *= (d / a);
		b *= (d / a);
		a *= (d / a);
		long double ansx=0, ansy=0;
		if (f - c != 0) {
			ansy = (f - c) / (e - b);
		}
		if (a != 0) {
			ansx = (c - ansy*b) / a;
		}
		ansx *= 1000;
		ansx = round(ansx);
		ansx /= 1000;
		ansy *= 1000;
		ansy = round(ansy);
		ansy /= 1000;
		if (ansx == 0) ansx = 0;
		if (ansy == 0) ansy = 0;
		printf("%.3LF %.3LF\n", ansx, ansy);
	}
}

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

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

int main(){
    double a[100]={0};
    double b[100]={0};
    double c[100]={0};
    double d[100]={0};
    double e[100]={0};
    double f[100]={0};
    int i=0;
    while(cin>>a[i]>>b[i]>>c[i]>>d[i]>>e[i]>>f[i]){
        i++;
        }
    for(int j=0;j<i;j++){
        float x=(b[j]*f[j]-e[j]*c[j])/(b[j]*d[j]-a[j]*e[j]);
        float y=(a[j]*f[j]-c[j]*d[j])/(a[j]*e[j]-b[j]*d[j]);
        cout<<setiosflags(ios::fixed)<<setprecision(3)<<x<<" "<<y<<endl;
        }
    
    return 0;
}

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

using namespace std;

#define Vi vector<int>
#define FOR(i,s,e) for (int i=s; i<e; i++)
#define ITER(v) v.begin(), v.end()

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b, c, d, e, f;
    double den, x, y;

    while (true) {
        cin >> a >> b >> c >> d >> e >> f;
        if (cin.eof()) { break; }
        den =  a * e - b * d;
        x = static_cast<double>(c * e - b * f) / den;
        y = static_cast<double>(- c * d + a * f) / den;
        // avoid -0.000
        x += 0.0
        y += 0.0
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }

    return 0;
}

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

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

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

}

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

using namespace std;

// 書き方程式を解く
// ax + by = c
// dx + ey = f
int main() {

    double a, b, c, d, e, f;
    vector<double> ansX;
    vector<double> ansY;
    
    double k1, k2, x, y;
    while (cin >> a >> b >> c >> d >> e >> f) {
        // (a * e)x + (e * b)y = (e * c)
        // (b * d)x + (b * e)y = (f * b)
        k1 = (e * c - f * b);
        k2 = (a * e - b * d);
        if (k1 == 0 && k2 < 0) k2 *= -1;
        x = k1 / k2;
        //(d * a)x + (d * b)y = (d * c)
        //(a * d)x + (a * e)y = (a * f)
        k1 = (d * c - a * f);
        k2 = (d * b - a * e);
        if (k1 == 0 && k2 < 0) k2 *= -1;
        y = k1 / k2;
        ansX.push_back(x);
        ansY.push_back(y);
    }
    
    for (int i = 0; i < ansX.size(); i++) {
        cout << fixed;
        cout << setprecision(3) << ansX[i] << " " << ansY[i] << endl;
    }
    
    return 0;
}

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

void OutputSolution(int a, int b, int c, int d, int e, int f)
{
	if(b == 0){
		double x = c / a;
		double y = (f-d*x) / e;
	}else{
		int B = b;
		a *= e;
		b *= e;
		c *= e;
		d *= B;
		e *= B;
		f *= B;
		double x = (c-f) / (a-d);
		double y = (c-a*x) / b;
	}
	cout << fixed << setprecision(3) << x << ' ' << y << endl;
}

int main()
{
	while(true){
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;
		OutputSolution(a, b, c, d, e, f);
	}
	return 0;
}

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

int main(){
	double a[6];
	double x,y;
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]){
		double b=a[0]*a[4]-a[1]*a[3];
		double c=a[0];
		a[0]=a[4];
		a[4]=c;
		a[1]*=-1.0;
		a[3]*=-1.0;
		x=(a[0]*a[2]+a[1]*a[5])/b;
		y=(a[3]*a[2]+a[4]*a[5])/b;
		printf("%.3f %.3f\n",x,y);
	}
	


	return 0;
}

C++: #include<iostream>
#include<stdio.h>
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-f*a)/(b*d-e*a);
		x=(c-b*y)/a;
		//cout<<x<<" "<<y<<endl;
		printf("%.3f %.3f%d",x,y);
	}
}

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

using namespace std;

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

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

C++: #include <stdio.h>
#pragma warning(disable : 4996)
long double a, b, c, d, e, f, x, y;
int main() {
    while (~scanf("%Lf%Lf%Lf%Lf%Lf%Lf", &a, &b, &c, &d, &e, &f)) {
        x = (c * e - b * f) / (a * e - b * d);
        y = (a * f - c * d) / (a * e - b * d);
        if (-0.0005 < x && x < 0.0005) x = 0.0;
        if (-0.0005 < y && y < 0.0005) y = 0.0;
        printf("%.3Lf %.3Lf\n", x, y);
    }
    return 0;
}