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(void){
	while(scanf("")!=EOF){
		float equ[2][3];
		for(int i=0;i<2;i++)
			for(int j=0;j<3;j++)
				cin >> equ[i][j];
		float delta = -equ[0][0]*equ[1][1]+equ[0][1]

*equ[1][0];
		float y = (-equ[0][0]*equ[1][2]+equ[0][2]*equ

[1][0])/delta;
		float x = (equ[0][2]-equ[0][1]*y)/equ[0][0];
		printf("%.3f %.3f\n",x,y);
	}
}

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

int main(){
	float x, y;
	int a, b, c, d, e, f, xx, yy;
	string p, q;
	while (true){
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()){
			break;
		}
		if (a == 0){
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (b == 0){
			x = c / a;
			y = (f - d * x) / e;
		}
		else if(d == 0){
			y = f / e;
			x = (c - b * y) / a;
		}
		else if(e==0){
			x = f / d;
			y = (c - a * x) / b;
		}
		else{
			x = (c*e - b*f) / (e*a - b*d);
			y = (c - a*x) / b;
		}
		xx = x / 1;
		yy = y / 1;
		p = to_string(xx);
		q = to_string(yy);
		p += ".";
		q += ".";
		b = x * 10;
		c = y * 10;
		for (int i = 1;i<4;i++){
			p += to_string((b*10) % 10);
			q += to_string((c*10) % 10);
			x = x * 10;
			y = y * 10;
			b = x;
			c = y;
		}
		cout << p << " " << q << endl;
	}
	return 0;
}

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

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

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

C++: #include <iostream>

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 = (c*d - a*f) / (b*d - a*e);

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

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

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

C++: /*
    ????????°??§???????????¨????????????
*/

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
#include <vector>
#include <map>
#include <utility>
#define LLU unsigned long long int
#define LL long long int
#define LD long double
using namespace std;
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
#define vd vector<int>
#define vLL vector<long long int>
#define vLLU vector<unsigned long long int> 
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define debug printf("asd\n")
#define debugd(a) printf("--%d\n",a)
#define debugdd(a,b) printf("--%d %d\n",a,b)
#define debugarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i]);printf("\n")
#define newline printf("\n")
#define forin(a,b,c) for(int a=b ; a<c ; a++)
#define forde(a,b,c) for(int a=b ; a<c ; a--)


inline void scd(int &a){scanf("%d",&a);}
inline void scdd(int &a,int &b){scanf("%d %d",&a,&b);}
inline void sctd(int &a,int &b,int &c){scanf("%d %d %d",&a,&b,&c);}
inline void scdlld(long int &a,long int &b){scanf("%I64d %I64d",&a,&b);}
inline void sclld(long long int &a){scanf("%I64d",&a);}

#define scarrd(a,b) for(int index=0 ; index<b ; index++)scanf("%d",&a[index])
#define prdlld(a,b) printf("%I64d %I64d",a,b)
#define prdd(a,b) printf("%d %d",a,b)
#define prd(a) printf("%d",a)
#define prarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i])
#define iniarr(a,b) for(int i=0 ; i<b ;i++)a[i]=0
#define arr(a,b) int *a=(int *)malloc(b*sizeof(int))
#define llarr(a,b) long long int *a=(long long int *)malloc(b*sizeof(long long int))
#define st(a,b) char *a=(char *)malloc(b*sizeof(char))
#define grav 9.8
#define pi 3.14159265

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

C++: /*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=jp*/

#include <iostream>

using namespace std;

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