Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

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

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
#include <vector>
#include <list>
#include <iterator>

#include <cstdio>

#define DIM 2

typedef std::vector<double> Vec;
typedef std::vector<Vec> Mat;
typedef std::pair<Mat,Vec> Eq;

int main(void){
	using namespace std;

	list<Eq> input;

	double a,b,c,d,e,f;

	cout << fixed << setprecision(3);

	while(cin >> a >> b >> c >> d >> e >> f){
		Vec m1, m2;
		m1.push_back(a);
		m1.push_back(b);
		m2.push_back(d);
		m2.push_back(e);

		Vec vec;
		vec.push_back(c);
		vec.push_back(f);

		Mat mat;
		mat.push_back(m1);
		mat.push_back(m2);

		Eq eq = make_pair(mat,vec);

		input.push_back(eq);
	}

	for(auto itr = input.begin(); itr!=input.end(); ++itr){
		auto mat = itr->first;
		auto vec = itr->second;

		Vec output(DIM);

		auto det = mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];
		std::transform(vec.begin(), vec.end(),vec.begin(), std::bind1st(multiplies<double>(),1.0/det));

		mat[0][1] = -mat[0][1];
		mat[1][0] = -mat[1][0];
		swap(mat[0][0],mat[1][1]);

		for (int i=0; i<DIM; i++){
			output[i] = inner_product(vec.begin(), vec.end(), mat[i].begin(), 0);
		}

		// cout << output[0] << " " << output[1];
		printf("%.3f %.3f",output[0],output[1]);
		if( std::next(itr)!=input.end() ){
			cout << endl;
		}
	}

}

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

int main()
{
	int a, b, c, d, e, f;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		double const denominator = a * e - b * d;
		std::cout.setf(std::ios::fixed);
		std::cout.precision(3);
		std::cout << std::showpoint
				  << (c * e - b * f) / denominator << ' '
				  << (a * f - c * d) / denominator << std::endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<cmath>
#define EPS 0.0000001

using namespace std;

main(){
  int a, b, c, d, e, f;
  double x, y;
  while ( cin >> a >> b >> c >> d >> e >> f ){
    x = 1.0 * ( c*e - b*f ) / ( a*e - b*d ) + EPS;
    y = 1.0 * ( c*d - a*f ) / ( b*d - a*e ) + EPS;
    printf("%.3lf %.3lf\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){
	
		if (a==0){
			y = c / b;
			x = (f - (e*c/b)) / d;
		}else if(b==0){
			x = c / a;
			y = (f - (d*c/a)) / e;
		}else if(d==0){
			y = f / e;
			x = (c - (b*f/e)) / a;
		}else if(e==0){
			x = f / d;
			y = (c - (a*f/d)) / b;
		}else{
			x = (f - (e*c/b)) / (d - (e*a/b));
			y = (f - (d*c/a)) / (e - (d*b/a));
		}
		printf("%.3f %.3f",x,y);
	}
	return 0;
}

C++: import java.util.Scanner;
public class Main
{
	public static void main(String[] args){
		//??\???a,b,c,d,e,f
		Scanner scan = new Scanner(System.in);
		//??£???????¨????ax+by=c, dx+ey=f???x,y????±???????
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int d = scan.nextInt();
		int e = scan.nextInt();
		int f = scan.nextInt();
		int a2 = scan.nextInt();
		int b2 = scan.nextInt();
		int c2 = scan.nextInt();
		int d2 = scan.nextInt();
		int e2 = scan.nextInt();
		int f2 = scan.nextInt();
		simultaneousEquation(a,b,c,d,e,f);
		simultaneousEquation(a2,b2,c2,d2,e2,f2);



	}

	//??£???????¨????????????????
	public static void simultaneousEquation(int a, int b, int c, int d, int e,int f){
		double x = 0;
		double y = 0;
		//a?????????????????°????????????
		int aCount = 1;
		//d?????????????????°????????????
		int dCount = 1;
		//b,e????¨?????????????????´???????
		int be;
		//b,y????¨?????????????????´???????
		double by;
		//c,f????¨?????????????????´???????
		int cf = 0;
		//ax????¨?????????????????´???????
		double ax;
		//a????????????????´???????
		int aFactorial = a;
		int dFactorial = d;

		while(true){
			if(a - d == 0){
				break;
			}
			if(a + d == 0){
				break;
			}
			if(Math.abs(a) < Math.abs(d)){
				a += aFactorial;
				aCount++;
			}
			if(Math.abs(a) > Math.abs(d)){
				d += dFactorial;
				dCount++;
			}
		}
		if(a - d == 0){
			be = b * aCount - e * dCount;
			cf = c * aCount - f * dCount;
			y = cf / be;
		}
		if(a + d == 0){
			be = b * aCount + e * dCount;
			cf = c * aCount + f * dCount;
			y = cf / be;
		}
		by = b * y;
		x = (c - by) / aFactorial;
		System.out.printf("%.3f %.3f\n",x,y);

	}
}

C++: #include <iostream>
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);
		if(-0.0004<x&&x<=0)x=0;
		if(-0.0004<y&&y<=0)y=0;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

int main(){
  for(double a1,b1,c1,d1,e1,f1,b2,c2,e2,f2,a3,c3,d3,f3,x,y;cin>>a1>>b1>>c1>>d1>>e1>>f1;){

    b2=b1*d1;
    c2=c1*d1;

    e2=a1*e1;
    f2=a1*f1;

    y=(c2-f2)/(b2-e2);
    if(y==-0.000){
      y=0.000;
    }

    a3=a1*e1;
    c3=c1*e1;

    d3=b1*d1;
    f3=b1*f1;

    x=(c3-f3)/(a3-d3);
    if(x==-0.000){
      x=0.000;
    }

    cout<<fixed<<setprecision(3)<<x;
    cout<<" ";
    cout<<fixed<<setprecision(3)<<y;
  }
  return 0;
}

C++: #include<stdio.h>
int main(void){
	int a,b,c,d,e,f;
	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){
		B=b*d;
		C=c*d;
		E=a*e;
		F=a*f;
		y=(C-F)/(B-E);
		A=a*e;
		C=c*e;
		D=b*d;
		F=b*f;
		x=(C-F)/(A-D);
		printf("%1.3lf %1.3lf\n",x,y);
		
	}
	return 0;
}

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

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

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

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

int main() {
        int a, b, c, d, e, f;
        double x, y;
        char line[200];

        while(fgets(line, 200, stdin) != NULL) {
                sscanf(line, "%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
                x = ((double)(e*c - b*f)) / (a*e - d*b);
                y = ((double)(a*f - d*c)) / (a*e - d*b);
                if(abs(x) < 1.0e-4) x = 0;
                if(abs(y) < 1.0e-4) y = 0;
                printf("%.3f %.3f\n", x, y);
        }
}