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>
#include <iomanip>
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)(c*e - b*f)/(a*e - b*d);
        y = (double)(c*d - a*f)/(b*d - a*e);
        cout << setprecision(3) << setiosflags(ios::fixed);
        cout << x+0.0000000001 << ' ' << y+0.0000000001 << endl;
    }
    return 0;
}

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

using namespace std;

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

	while(cin >> a >> b >> c >> d >> e >> f){
			delta = (a * e) - (b * d);

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

			if(x == 0) x = 0;
			if(y == 0) y = 0;

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

	return 0;
}

C++: #include<stdio.h>
int main(){
	int X,Y;
double a,b,c,d,e,f,x,y;
double p[2][3]={0};
y=0;x=0;
 while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){

y=(d*c-a*f)/(b*d-a*e);
x=(e*c-b*f)/(e*a-b*d);
X=x*10000;
Y=y*10000;
if((X)%10>=5)x+=0.0005;
else if((X)%10<=-5)x-=0.0005;
if((Y)%10>=5)y+=0.0005;
else if((Y)%10<=-5)y-=0.0005;

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

C++: #include <cstdio>

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){
		x = (double)(e*c-b*f)/(e*a-b*d);
		y = (double) (c-a*x)/b;
		if(0.0001>x&&x>-0.0001) x=0;
		if(0.0001>x&&x>-0.0001) y=0;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>


#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;


double A[2][2];
double C[2];


int main()
{
	while (cin >> A[0][0] >> A[0][1] >> C[0] >> A[1][0] >> A[1][1] >> C[1]){
		double t = A[1][0] / A[0][0];
		A[1][0] -= A[0][0] * t;
		A[1][1] -= A[0][1] * t;
		C[1] -= C[0] * t;

		t = A[0][1] / A[1][1];
		A[0][1] -= A[1][1] * t;
		C[0] -= C[1]*t;

		printf("%.3lf %.3lf\n", C[0] / A[0][0], C[1] / A[1][1]);
	}




}

C++: #include<cstdio>
int main(void)
{
	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)
	{
		y=(a*f-d*c)/(-(d*b)+a*e);
		x=(c-b*y)/a;
		if(x==0)
		{
			x=0;
		}
		if(y==0)
		{
			y=0;
		}
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}
/*
ax=c-by
->x=(c-by)/a
d((c-by)/a)+ey=f
(dc-dby)/a+ey=f
(dc-dby)+aey=af
-dby+aey=af-dc
y(-db+ae)=af-dc
->y=(af-dc)/(-db+ae)
*/

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

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x = double(c*e-f*b)/double(a*e-d*b);
		double y = double(c*d-f*a)/double(b*d-a*e);
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
}

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

int main(){
    	int a, b, c, d, e, f;
	double x, y;
	while(1){
	if (!(cin>>a>>b>>c>>d>>e>>f))break;
		x=(double)(1.0/(a*e-b*d))*(e*c-b*f);
		y=(double)(1.0/(a*e-b*d))*(-d*c+a*f);
		cout << (double)x << " " << (double)y << endl;
	}
	return 0;
}

C++: #include <cstdio>

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)) {
		y = (a * f - c * d) / (a * e - b * d);
		x = (c * e - b * f) / (a * e - b * d);
		printf("%.3f %.3f\n", x, y);
	}
}

C++: 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line ="";
		while((line = br.readLine())!=null){
			String[] s= line.split(" ");
			int a = Integer.parseInt(s[0]);
			int b = Integer.parseInt(s[1]);
			int c = Integer.parseInt(s[2]);
			int d = Integer.parseInt(s[3]);
			int e = Integer.parseInt(s[4]);
			int f = Integer.parseInt(s[5]);
			int x = (e*c - b*f)/(a*e - b*d);
			int y = (a*f - c*d)/(a*e - b*d);
			System.out.println(x+" "+y);
		}

	}

}

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

using namespace std;

double EPS = 1e-9;

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

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

int main( void )
{
	float a,b,c,d,e,f;
	while( scanf( "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f ) )
	{
		if( feof( stdin ) ) break;
		float det = 1.0f / ( a*e - b*d );
		float x = det * ( e*c - b*f );
		float y = det * ( -c*d + a*f );
		if( fabs( x ) < 0.001f ) x = 0.0f;
		if( fabs( y ) < 0.001f ) y = 0.0f;
		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) {
		
		x = (c*e - b*f) / (a*e-b*d);
		y = (c*d - a*f) / (b*d - a*e);

		printf("%.3lf %.3lf\n",x,y);

	}

	return 0;

}

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) + 0.0
            << " "
            << (a*f - c*d)/(a*e - b*d) + 0.0 << endl;

    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>

using namespace std;

int main(){

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

	while(cin >> a >> b >> c >> d >> e >> f){
		A = a*e - b*d;
		x = (e*c - b*f) / A;
		y = (a*f - d*c) / A;
		cout << fixed << setprecision(3);
		cout << x <<" "<< y << endl;
		//printf("%.3f %.3f\n", x , y );
	}



	return 0;
}

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

using namespace std;

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

	while (cin >> a >> b >> c >> d >> e >> f){
		ac = a;
		dc = d;
		a *= dc;
		b *= dc;
		c *= dc;
		d *= ac;
		e *= ac;
		f *= ac; 		
		ny = b - e;
		li = c - f;
		y = li / ny;
		x = (c - b * y) / a;		

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