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<iostream>
#include<iomanip>

using namespace std;

int main(){
	cout << setprecision(3) << setiosflags(ios::fixed);
	while(1){
	double a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;

	cout << (c*e-f*b)/(a*e-d*b) << " " << (c*d-f*a)/(b*d-a*e) << '\n';

	}
	return 0;
}

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

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

C++: #include <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

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

C++: /*****include*****/
#include <iostream>
#include <fstream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return;
	}
#endif
	/*****変数置き場*****/
	double a1,b1,c1,a2,b2,c2;
	/*****処理部*****/
	while(1){
		cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
		b1 = b1 / a1;
		c1 = c1 / a1;
		a1 = 1;
		b2 = b2 / a2;
		c2 = c2 / a2;
		a2 = 1;
		b2 = b2 - b1;
		c2 = c2 - c1;
		a2 = 0;
		a1 = a1 / b1;
		c1 = c1 / b1;
		c2 = c2 / b2;
		c1 = c1 - c2;
		c1 = c1 / a1;
		if(c1 == 0)	c1 = 0;
		if(c2 == 0)	c2 = 0;
		printf("%.3f %.3f\n",c1,c2);
	}
	//cout << set.w(5) << c1 << " " << c2 << endl;

	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

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

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

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

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

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    float a,x,b,y,c,f,e,d,y2,x2;
    while(cin>>a>>b>>c>>d>>e>>f){
        y2=b*e*y;
        x2=a*d;
       //(a*e)*x+y2=c*e  (d*b)*x+y2=f*b    (a*e)*x=c*e
                   //(a*e-d*b)*x=(c*e-f*b-y2*2)
        x=(c*e-f*b-y2*2)/(a*e-d*b);
        //a*x+b*y=c
        y=(c-(a*x))/b;
        
        printf("%.3f %.3f",x,y);cout<<endl;
            //y=(c*d)/(b*d);
        
    }
    
    return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(8);
    double a1, b1, c1, a2, b2, c2;
    while(cin>>a1>>b1>>c1>>a2>>b2>>c2){
        double m = a1*b2-a2*b1;
        double x=(c1*b2-c2*b1)/m, y=(a1*c2-a2*c1)/m;
        if(fabs(x)<1e-9) x=0;
        if(fabs(y)<1e-9) y=0;
        cout<<x<<' '<<y<<'\n';
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;
typedef long long ll;
int a, b, c, d, e, f;

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

C++: #include<stdio.h>
int main(void)
{
	float e2,f2,c2;
	float a1,b1,c1,d1,e1,f1;
	float a,b,c,d,e,f;
	float add,x,y;
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
		if(a==0||d==0){
			printf("0.000 0.000\n");
			continue;
		}
		else{
			add=a/d;
		}
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		e2=b-e1;
		f2=c-f1;
		if(f2==0||e2==0){
			printf("0.000 0.000\n");
			continue;
		}
		else{
			y=f2/e2;
		}
		add=b/e;
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		a1=a-d1;
		c2=c-f1;
		x=c2/a1;
		printf("%0.3f %0.3f\n",x,y);
	}
	return 0;
}
/*
1x+2y=3
4x+5y=6
a  b  c
1x+2y=3;
1.6x+2y=1.2
d    e   f
-0.4x=1.8
*/

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

int main() {
  double m[2][3], x[2];
  double a, b, c, d, e, f;
  int p, q;
  bool zf;
  while (cin>>m[0][0]>>m[0][1]>>m[0][2]>>m[1][0]>>m[1][1]>>m[1][2]) {
    zf = false;
    for (int i=0;i<2;i++) {
      for (int j=0;j<2;j++) {
        if (m[i][j] == 0) {
          p = i; q = j;
          zf = true;
        }
      }
    }
    if (zf) {
      x[1-q] = m[p][2] / m[p][1-q];
      x[q] = (m[1-p][2] - m[1-p][1-q] * x[1-q]) / m[1-p][q];
    } else {
      a = m[0][0]; b = m[0][1]; c = m[0][2];
      d = m[1][0]; e = m[1][1]; f = m[1][2];
      x[1] = (f - d*c/a) / (e - d*b/a);
      x[0] = (c - b*x[1]) / a;
    }

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

C++: #include<stdio.h>
int main(void)
{
	int b,a,e,d,f,i,c;
	float y,x;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)  {
			y=(c*d-a*f)/(b*d-a*e);
			x=(c*e-b*f)/(a*e-b*d);
		if(x<0.0000 && x>-0.0000001){
			x=0.0000;
		}
		if(y<0.000&&y>-0.0000001){
			y=0.0000;
		}	
		printf("%.3f %.3f\n",x,y);
	}
	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) != EOF){
		float by = d/a,x,y;
		y = (c*by-f)/(b*by-e);
		x = (c - b*y)/a;
		printf("%.3f %.3f\n",x,y);
	}
	
	return 0;
}

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

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