Go: package main

import "fmt"

func main() {

	for {
		var a, b, c, d, e, f float64
		var x, y float64
		i, _ := fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if i != 6 {
			return
		}

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

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>

using namespace std;

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

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5){
		a=a+10-int(a)%10;
	}else{
		a=a-int(a)%10;
	}
	
	a=double (int (a/10));
	a=a/10000;

}
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){
		y=(c*d-a*f)/(b*d-a*e);
		x=(c-b*y)/a;
		/*
		x=round3(x);
		y=round3(y);
		*/
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>

using namespace std;

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

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

C++: ///
// File:  0004.cpp
// Author: ymiyamoto
//
// Created on Wed Nov  8 21:45:53 2017
//

#include <cstdint>
#include <iomanip>
#include <iostream>

using namespace std;

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

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

  return 0;
}

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

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

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

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

    y=(c2-f2)/(b2-e2);

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

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

    x=(c3-f3)/(a3-d3);

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

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 = (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(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;
}