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

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

int main() {
    string line;
    while (getline(cin, line)) {
        int a, b, c, d, e, f;
        stringstream ss(line);
        ss >> a >> b >> c >> d >> e >> f;

        double x, y;
        if (b*d != a*e) {
            y = static_cast<double>(c*d - a*f) / (b*d - a*e);
            x = static_cast<double>(c - b*y) / a;
        } else {
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
            y = static_cast<double>(c - a*x) / b;
        }
        cout.precision(4);
        cout << showpoint << x << " " << y << endl;
    }
}

C++: #include <iostream>
#include <string>
#include <cctype>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <map> // pair
#include <set>
#define MAXSIZE 200000
#define PI 3.141592653589
using namespace std;

template<typename T>
T add(T a,T b){
  return a+b;
}

namespace A
{
  int f(void){
    return 1;
  }
}

int main(){
  int a,b,c,d,e,f;
  while (std::cin >> a>>b>>c>>d>>e>>f) {
    double x=(1.0)*(b*f-c*e)/(b*d-a*e);
    double y=(1.0)*(c*d-a*f)/(b*d-a*e);
    if(x>-0.001&&x<0.001)x=0.000;
    if(y>-0.001&&y<0.001)y=0.000;
    printf("%.3f %.3f\n",x,y);
  }

}

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f,g,h,i,j,k,l;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
	g=b*d;
	h=e*a;
	i=c*d;
	j=f*a;
	k=g-h;
	l=i-j;
	y=(double)l/(double)k;
	x=((double)c-(double)b*(double)y)/(double)a;
	printf("%.3f %.3f",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;
	
	cin >> a >> b >> c >> d >> e >> f ;
	
	y = (f - d*c/a )/(e - b*d/a );
	x = (c - b*y)/a;
	
//	cout << x << endl << y << endl;
	printf("%.3f ",x);
	printf("%.3f\n",y);
	
}

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

C++: #include <cstdio>

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

	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		g=a*e-b*d;
		printf("%lf %lf\n",(e*c+(-b)*f)/g,((-d)*c+a*f)/g);
	}
	return 0;
}

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

int main(void){

	while (true){
		float a, b, c, d, e, f;
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

		float x, y;
		x = (c*e-b*f)/(a*e-b*d);
		y = -(c*d-a*f)/(a*e-b*d);
		cout<<fixed<<setprecision(3);
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

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

C++: #include <iostream>
#include <math.h>
#include <cstdio>

using namespace std;

int main() {
	char s[1000];
	while (1) {
		string str;
		if ( !getline(cin, str) ) break;

		for (int i = 0; i < str.size(); ++i)
			s[i] = str[i];
		s[str.size()] = '\0';

		double a, b, c, d, e, f;
		sscanf(s, "%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);

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

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

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

int main()
{
    // your code goes here
    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 = (c - a * x) / b;
        if (x == -0.0)
        {
            x = 0.0;
        }
        if (y == 0.0)
        {
            y = 0.0;
        }
        printf("%.3lf %3lf\n", x, y);
    }
    return 0;
}

C++: #include<stdio.h>
int main(void){
  float a,b,c,d,e,f,x,y,i;
  while(scanf("%d %d %d %d %d %d",&a, &b,&c,&d,&e,&f)!=EOF){
    x=(e*c-b*f)/(a*e-b*d);
    y=(a*f-c*d)/(a*e-b*d);
    printf(" %.3f %.3f\n",x,y);}




  return 0;
}

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

int main()
{
	float a, b, c, d, e, f;
	while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF)
	{
		float x = ((c * e) - (b * f)) / ((a * e) - (b * d));
		float y = ((a * f) - (c * d)) / ((a * e) - (b * d));
		if (x <= 0.0000 &&x > -0.0005)x = 0.000;
		if (y <= 0.0000 &&y > -0.0005)y = 0.000;
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
        double a,b,c,d,e,f;
        while(cin>>a,cin>>b>>c>>d>>e>>f){
           cout<<setprecision(3)<<fixed<<(f-e/b*c)/(d-e/b*a)<<" "<<(f-d/a*c)/(e-d/a*b)<<endl;
        }
	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-(b*y))/a;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	double aa=1000,bb=1000;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		
		if (b==0){
			y2=(f-d*x2)/b;
		}
		
		
		
		if (x<0.0005 && x>-0.0005){
			x=0;
		}
		if (y<0.0005 && y>-0.0005){
			y=0;
		}
	//	printf("%.3f %.3f\n",x,y);
	//	printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
	//	printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}

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

int main()
{
	double a, b, c, d, e, f, x, y;
	std::cout << std::fixed << std::setprecision(3);
	while (std::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.001 < x && x < 0.001)
			x = 0;
		if (-0.001 < y && y < 0.001)
			y = 0;
		std::cout << x << " " << y << std::endl;
	}

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
#include<map>
#include<cmath>

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-(a*x))/b;
		cout<<fixed<<setprecision(3)<<x<<' '<<fixed<<setprecision(3)<<y<<endl;
		
	}

	return 0;
}