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<stdio.h>
#include<math.h>
int main(void){
    double a,b,c,d,e,f,A,x,y,X,Y,Z;

    while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
    A=a;
    a=a*d,b=b*d,c=c*d;
    d=d*A,e=e*A,f=f*A;

    Y=b-e,Z=c-f;
    y=Z/Y;
    x=(c-y*b)/a;
    x=x+0.0005,y=y+0.0005;
    x=x*1000,y=y*1000;
    x=floor(x);
    y=floor(y);
    x=x/1000,y=y/1000;
    if(x==-0)x=0;
    if(y==-0)y=0;
   printf("%.3lf %.3lf\n",x,y);
    }
   // printf("\na%lf\nb%lf\nc%lf\nd%lf\ne%lf\nf%lf\n%lf\n%lf",a,b,c,d,e,f,Y,Z);

    return 0;
}

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

int main()
{
    int a,b,c,d,e,f;
    double x,y;
    for(int i=0;i<2;i++){
        cin>>a>>b>>c>>d>>e>>f;
        double l,m,n;
        l=a/d;
        m=b-e*l;
        n=c-f*l;
        y=n/m;
        x=(c-b*y)/a;
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-8;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int main(){
    double a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        double y=(a*f-c*d)/(a*e-b*d);
        double x=(-b*y+c)/a;
        x*=1000;
        printf("%.3f ",round(x)/1000);
        y*=1000;
        printf("%.3f\n",round(y)/1000);
    }
}

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

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		X= floor(X*1000+0.5)/1000;
		Y= floor(Y*1000+0.5)/1000;

		if(Y==0){
			Y=0;
		}

		if(X==0){
			X=0;
		}

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}

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

/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	double a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 0
	while (cnt < 1) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		if (
			((a < -1000) && ( 1000 < a)) ||
			((b < -1000) && (1000 < b)) ||
			((c < -1000) && (1000 < c)) ||
			((d < -1000) && (1000 < d)) ||
			((e < -1000) && (1000 < e)) ||
			((a < -1000) && (1000 < f))
			) {
			break;
		}
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		std::cout << std::fixed << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::fixed << std::setprecision(3) << y_vector[i] << endl;
	}

	cnt = 0;
	x_vector.clear();
	y_vector.clear();

	//???????????°
	//while (1);

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	long long a,b,c,d,e,f;
	double x,y;
	while(cin >> a >> b >> c >> d >> e >> f){
		x=(double)(c*(a*e-b*d)-b*(a*f-c*d))/(double)(a*(a*e-b*d));
		y=(double)(a*f-c*d)/(double)(a*e-b*d);
		if(x==-1*0)x=0;
		if(y==-1*0)y=0;
		printf("%.6lf %.6lf\n",x,y);
	}
	return 0;
}

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

double halfadjust(double x){
	int tmp = static_cast<int>(x*10000);
	double ans = static_cast<double>(tmp)/10000;
	tmp = tmp%10;
	if(tmp >= 5)
		ans += 0.001;
	return ans;
}

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

void solve(){
	double x = (c*e-b*f)/(a*e-b*d);
	double y = (c*d-a*f)/(b*d-a*e);
	cout << setprecision(3) << fixed << halfadjust(x) << ' ';
	cout << halfadjust(y) << std::endl;
	//cout << setprecision(6);
}

int main(){
	while(cin >> a && cin >> b && cin >> c && cin >> d && cin >> e && cin >> f){
		if((!a&&!b)||(!d&&!e))
			break;
		solve();
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
int main(){
	float a, b, c, d, e, f;
	float x, y;
	while (std::cin >> a >> b >> c >> d >> e >> f){
		if (a*d<0){
			d = -d;
			e = -e;
			f = -f;
		}

		x = (c - b*(c - f*a / d) / (b - e*a / d)) / a;
		y = (c - f*a / d) / (b - e*a / d);
		if (x == 0)x = 0;
		if (y == 0)y = 0;
		x = round(x);
		y = round(y);
		std::cout<<std::fixed<<std::setprecision(4)  << x << " " << y << std::endl;
	}
	return 0;

}

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main(){
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x, y;
		y = (a*f - c*d) / (a*e - b*d);
		x = (c - b*y) / a;
		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;
	while(cin>>a>>b>>c>>d>>e>>f){     
	  cout<<fixed<<setprecision(4);
	  cout <<(e*c - b*f) / (a*e - b*d) << " " << (a*f - d*c) / (a*e - b*d) << endl;
	}

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
int main() {
	float a,b,c,d,e,f,x,y;
	while(true){
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof())break;
		x=c*e-b*f;
		y=a*f-c*d;
		x/=a*e-d*b;
		y/=a*e-d*b;
		printf("%.3f %.3f\n",x,y);
	}
}

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

int det(int a00, int a01, int a10, int a11)
{
	return a00*a11 - a01*a10;
}

int main()
{
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		int t = det(a, b, d, e);
		cout << fixed << setprecision(3) << (double)det(c, b, f, e) / t << ' ' << (double)det(a, c, d, f) / t << endl;
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void) {
	char string[54];
	double a, b, c, d, e, f, x, y;
	scanf("%s",string);
	
	a = atof(strtok(string, " "));
	b = atof(strtok(NULL, " "));
	c = atof(strtok(NULL, " "));
	d = atof(strtok(NULL, " "));
	e = atof(strtok(NULL, " "));
	f = atof(strtok(NULL, " "));

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

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

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

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

  while(cin >> a >> b >> c >> d >> e >> f){
  

    y = (c*d - f*a)/(b*d-e*a);
    x = (b*y - c)/a;
    
    
    x*=1000;
    y*=1000;
    
    // x+=0.5;
    //y+=0.5;
    
    x/=1000;
    y/=1000;
    
    //cout << x << y << endl;
    printf("%.3f %.3f\n", x, y);
  }

  return 0;
}