Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a, b, c, d, e, f float64
		i, _ := fmt.Scan(&a, &b, &c, &d, &e, &f)
		if i == 0 {
			break
		}

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

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

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

using namespace std;

int main (int argc, char const* argv[])
{
    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*d - a*f) / (b*d - a*e);

        x = round(x * 1000)/1000.0;
        y = round(y * 1000)/1000.0;
        
        if(x == 0)x = 0;
        if(y == 0)y = 0;
        
        printf("%.03lf %.03lf\n",x,y);
    }
    
    return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
#include <limits>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ld long double
ld a, b, c, d, e, f, x, y;
ld shish(ld a)
{
	if (a == 0) { return a; }
	
	a *= 1000;
	if (a > 0) {
		a += 0.51;
	}
	else {
		a -= 0.51;
	}
	a = (ld)((int)a);
	a /= 1000;
	return a;
}
int main() {
	while (cin >> a >> b >> c >> d >> e >> f) {
		y = (a*f - c*d) / (ld)(a*e - b*d);
		x = (c*e - f*b) / (ld)(a*e - b*d);

		x = shish(x);
		y = shish(y);
		if (x == 0) { cout << "0.000"; }
		else {
			cout << fixed << setprecision(3) << x;
		}
		cout << " ";
		if (y == 0) { cout << "0.000" << endl; }
		else{
			cout << fixed << setprecision(3) << y << endl;
		}
	}
	return 0;
}

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

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

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

	return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    double a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(b*f-c*e)/(b*d-a*e);
        y = (a*f-c*d)/(a*e-b*d);
        if(x == 0) x = 0.000;
        if(y == 0) y = 0.000;
        cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
    }
    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始！ */
/* 入力終了！ */
int main(void)
{
   int n;
   double a,b,c,d,e,f;
   double x,y;
   while(cin >> a) {
      cin >> b >> c >> d >> e >> f;
      y = (a*f-d*c)/(a*e-b*d);
      x = (c - b*y)/a;
      printf("%.3f %.3f\n",x,y);
   }

   return 0;
}

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