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>
#include <iomanip>
#include <stdio.h>
#include <math.h>
using namespace std;

double* solve_equations(double *a)
{
	// クラメルの公式を用いる
	int data_size=sizeof(a[0]);
	/*cout << "data_size=" << data_size << endl;
	cout << "a=" << a << endl;
	cout << "*(a + data_size*1)=" << *(a + 1) << endl;
	cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */
	double z = *(a + 0) * *(a + 4) 
		   - *(a + 1) * *(a + 3);
	double x = *(a + 2) * *(a + 4)
		   -	*(a + 1) * *(a + 5);
	double y = *(a + 0) * *(a + 5)
		   - *(a + 2) * *(a + 3); 
	double ax,ay;
	/*cout << "x=" << x << endl;
	cout << "y=" << y << endl;*/
	ax = pow(z,-1)*x;
	ay = pow(z,-1)*y;
	
	/* cout << ax << endl;
	cout << ay << endl; */
	double ans[2] = {ax,ay};
	return ans;
}

int main()
{
	double n[6];
	double s;
	int i=0;
	while (cin >> s){
		if (i == 5){
			n[i]=s;
			/* for (int j=0;j<=5;j++)
			{
				cout << "n[" << j << "]=" << n[j] << endl;
			}*/
			double* an;
			an = solve_equations(n);
			/* printf("%.3lf",*(an+0));
			cout << " " << endl;
			printf("%.3lf",*(an+1)); */
			if (an[1] == 0)
				cout << fixed << setprecision(3) << an[0] << " " << 0.000 << endl;
			else if(an[0] == 0)
				cout << fixed << setprecision(3) << 0.000 << " " << an[1] << endl;
			else
				cout << fixed << setprecision(3) << an[0] << " " << an[1] << endl;

			i = 0;}
		else{
			n[i]=s;
			i++;
		}
	}
	return 0;
			// cout << l[0]  endl;
}

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

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

C++: #include<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
double a, b, c, d, e, f;

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double m[2][2],x[2],mi[2][2],det;
  while(cin >>m[0][0]>>m[0][1]>>x[0]>>m[1][0]>>m[1][1]>>x[1]){
    det = m[0][0]*m[1][1]-m[0][1]*m[1][0];
    mi[0][0] = m[1][1]/det;
    mi[0][1] = -m[0][1]/det;
    mi[1][0] = -m[1][0]/det;
    mi[1][1] = m[0][0]/det;
    printf("%.3lf %.3lf\n",x[0]*mi[0][0]+x[1]*mi[0][1],x[0]*mi[1][0]+x[1]*mi[1][1]);
  }
  return 0;
}

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){

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

    x=(c-b*y)/a;

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

C++: #include <iostream>

using namespace std;

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

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

static double
round3(double r)
{
	r *= 1000.0;
	r = round(r);
	return (r / 1000.0);
}

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

	while (gets(line)) {
		if (sscanf(line, "%lf %lf %lf %lf %lf %lf",
				   &a, &b, &c, &d, &e, &f) == 6) {
			x = (c/a - (b*f)/(a*e))*((a*e)/(a*e - b*d));
			y = f/e - (d/e) * x;
			
			printf("%.3f %.3f\n", round3(x), round3(y));
		}
	}

	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
 
int main(){
    double a, b, c, d, e, f, x, y, det;
    while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){
        det = b * d - a * e;
        y = (c * d - a * f) / det;
        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;
	while(cin >> a >> b >> c >> d >> e >> f){
		x=(f-c*e/b)/(d-a*e/b);
		y=(f-c*d/a)/(e-b*d/a);

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

	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",x,y);
	}
}

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

int gcd(int a,int b){
	if(a<b)b%=a;
	if(b==0)return a;
	int c=b;b=a%b;a=c;
	return gcd(a,b);
}

int lcm(int a,int b){
	int c=gcd(a,b);
	return c*(a/c)*(b/c);
}

int main(){
	int a,b,c,d,e,f;
	double x,y;
	std::cin>>a>>b>>c>>d>>e>>f;
	int g=lcm(a,d);
	y=(c*g/a-f*g/d)/(b*g/a-e*g/d);
	x=(c-y*b)/a;
	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;
	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<=0&&x>=(-0.0005))x=0;
		if(y<=0&&y>=(-0.0005))y=0;
		printf("%.3f %.3f\n",x,y);
		
	}
}

C++: main(){
    double a,b,c,d,e,f,t;
    for(;scanf("%lf%lf%lf&lf%lf%lf",&a,&b,&c,&d,&e,&f)==6;){
        t=a*e-b*d;
        printf("%.3lf%.3lf\n",(e*c-b*f)/t+0.0,(a*f-d*c)/t+0.0);
    }
    return 0;
}

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

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

		x == 0 ? x = 0.0L : x = (c*e - b*f) / (a*e - b*d);
		y == 0 ? y = 0.0L : y = (c*d - a*f) / (b*d - a*e);

		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,x,y;

	while(cin>>a>>b>>c>>d>>e>>f)
	{
		x=(e*c-b*f)/(a*e-b*d);
		y=(c*d-a*f)/(b*d-a*e);
		if(x==-0)x=0;
		if(y==-0)y=0;

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

//大文字を小文字に変換
/*
for(int i=0;i<inp.size();i++)
if(inp[i]>='A' && inp[i]<='Z')
inp[i]+='a'-'A';
*/

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 * 10000 >= 5){
				x += 0.001;
			}if(y * 10000 >= 5){
				y += 0.001;
			}

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

	return 0;
}

C++: 
import java.util.Scanner;
public class main{
	static int a,b,c,d,e,f;
	static double x,y;
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(true){
		a = s.nextInt();
		b = s.nextInt();
		c = s.nextInt();
		d = s.nextInt();
		e = s.nextInt();
		f = s.nextInt();
		x = (e*c-b*f)/(a+e-b*d);
		y = (a*f-d*c)/(a*e-b*d);
		System.out.printf("%4.3f",x);
		System.out.print(" ");
		System.out.printf("%4.3f",y);
		}
	}

}