Go: package main

import "fmt"

func main() {
	var resultX, resultY [100]float32
	var count int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		//Simultaneous equation
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		resultX[count] = x
		resultY[count] = y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%.3f %.3f\n", resultX[i], resultY[i])
	}
}

C++: #include<iostream>
#include<iomanip>
#define x_Formula(a,b,c,d,e,f) (c-(b*f)/e)/(a-(b*d)/e);
#define y_Formula(x,a,b,c) (c-(a*x))/b;

using namespace std;

double num[6];

void serch(double s_x,double s_y)
{
	int xx,yy;
	xx=s_x*10000.0;
	yy=s_y*10000.0;
	if((xx*10000)%10>4)
		s_x+0.001;
	if((yy*10000)%10>4)
		s_y+0.001;
}
int main()
{
	int i;
	
	for(;cin >> num[0];)
	{
		for(i=1;i<6;i++)
			cin >> num[i];
		
		double x=x_Formula(num[0],num[1],num[2],num[3],num[4],num[5])
		double y=y_Formula(x,num[0],num[1],num[2])
		
		cout << setprecision(3);
		cout << setiosflags(ios::scientific);
		cout << fixed ;
		serch(x,y);
		cout << x << " " << y << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	float e2,f2,c2;
	float a1,b1,c1,d1,e1,f1;
	float a,b,c,d,e,f;
	float add,x,y;
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
		add=a/d;
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		e2=b-e1;
		f2=c-f1;
		y=f2/e2;
		add=b/e;
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		a1=a-d1;
		c2=c-f1;
		x=c2/a1;
		printf("%f %f\n",x,y);
	}
	return 0;
}
/*
1x+2y=3
4x+5y=6
a  b  c
1x+2y=3;
1.6x+2y=1.2
d    e   f
-0.4x=1.8
*/

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iomanip>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <sstream>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<(DUMP(),__VA_ARGS__).str()<<" ["<<__LINE__<<"]"<<endl)
struct DUMP:ostringstream{template<class T>DUMP &operator,(const T&t){if(this->tellp())*this<<", ";*this<<t;return *this;}};
#else
#define dump(...)
#endif

ll cross(ll a, ll b, ll c, ll d) {
    return a*d - b*c;
}

int main() {
    ll a[6];
    while(cin) {
        rep(i,6) cin>>a[i];
        if(!cin) break;
        ll d =  cross(a[0], a[1], a[3], a[4]);
        ll x1 = cross(a[2], a[1], a[5], a[4]);
        ll x2 = cross(a[0], a[2], a[3], a[5]);
        cout << setprecision(3) << fixed;
        cout << 1. * x1 / d + 1e-9 << " ";
        cout << 1. * x2 / d + 1e-9 << endl;
    }
}

C++: #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>
#include<iomanip>

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

using namespace std;

int main(){


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

	while(true){

	cin >> a >> b >> c >> d >> e >> f;

	if(cin.fail()) break;

	double z=a*e-b*d;

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


	if(x==-0.0000) x=0.0000;
	if(y==-0.0000) y=0.0000;



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

	}


	return 0;
}

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

		double x=(c-b*y)/a;
	
	printf("%.3f %.3f\n",x,y);

	}

 

	return 0;

}

C++: #include <iostream>

using namespace std;

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

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

using namespace std;

void solve(int a, int b, int c, int d, int e, int f) {
	double x = (f - (double)e*c/b) / (d - (double)e*a/b);
	double y = (c - a*x) / b;
	if (x == 0) x = 0.000;
	if (y == 0) y = 0.000;
	printf("%4.3f %4.3f\n", x, y);
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

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



  return 0;
}

C++: #include<stdio.h>
int main()

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

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

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

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 = (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 <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;

#define GET_ARG(a,b,c,F,...) F
#define REP3(i,s,e) for (i = s; i <= e; i++)
#define REP2(i,n) REP3 (i,0,(int)(n)-1)
#define REP(...) GET_ARG (__VA_ARGS__,REP3,REP2) (__VA_ARGS__)
#define RREP3(i,s,e) for (i = s; i >= e; i--)
#define RREP2(i,n) RREP3 (i,(int)(n)-1,0)
#define RREP(...) GET_ARG (__VA_ARGS__,RREP3,RREP2) (__VA_ARGS__)
#define DEBUG(x) cerr << #x ": " << x << endl

int main(void) {
    int a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double det = a * e - b * d;
        int x = e * c - b * f;
        int y = a * f - d * c;
        if (x == 0) cout << 0 << " ";
        else cout << x / det << " ";
        if (y == 0) cout << 0 << endl;
        else cout << y / det << endl;
    }
    return 0;
}

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

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

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

/*
ax + by = c
dx + ey = f

x = (c-by)/a
d(c-by)/a + ey = f
dc/a - dby/a + ey = f
ey - dby/a = f - dc/a
y(e-db/a) = f - dc/a
y = (f-dc/a)/(e-db/a)

aex + bey = ce
bdx + bey = bf
aex - bdx = ce - bf
x(ae - bd) = ce - bf
x = (ce - bf)/(ae - bd)
by = c - ax
y = (c - ax)/b
*/
int main()
{
    while(true){
        double a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if(std::cin.eof()) break;
        if(b){
            double x = (c*e - b*f) / (a*e - b*d);
            double y = (c - a*x) / b;
        }else{
            double y = (f-d*c/a)/(e-d*b/a);
            double x = (c-b*y)/a;
        }
        std::cout << std::fixed << std::setprecision(3);
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}