Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                fmt.Printf("%04f %04f\n", x, y)
        }
}

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);
        }
}

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

        printf("%.3f %.3f\n", x == -0 ? 0 : x, y == -0 ? 0 : y);
    }

    return 0;
}

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

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

  while(std::cin >>a>>b>>c>>d>>e>>f){
    std::cout << std::fixed;
    std::cout << std::setprecision(3) << (c*e-b*f)/(a*e-b*d);
    std::cout << " " << (a*f-c*d)/(a*e-b*d) << std::endl;
  }
}