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 <cmath>
using namespace std;

int main(){
	float x, y;
	int a, b, c, d, e, f, p[4], q[4];
	while (true){
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()){
			break;
		}
		if (a == 0){
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (b == 0){
			x = c / a;
			y = (f - d * x) / e;
		}
		else if(d == 0){
			y = f / e;
			x = (c - b * y) / a;
		}
		else if(e==0){
			x = f / d;
			y = (c - a * x) / b;
		}
		else{
			x = (c*e - b*f) / (e*a - b*d);
			y = (c - a*x) / b;
		}
		p[0] = x / 1;
		q[0] = y / 1;
		b = x * 10;
		c = y * 10;
		for (int i = 1;i<4;i++){
			p[i] = (b*10) % 10;
			q[i] = (c*10) % 10;
			x = x * 10;
			y = y * 10;
			b = x;
			c = y;
		}
		cout << p[0] << "." << p[1] << p[2] << p[3] << " " << q[0] << "." << q[1] << q[2] << q[3] << endl;
	}
	return 0;
}

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

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

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

C++: #include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (((ll)1<<31)-1)
#define eps LDBL_EPSILON
#define moder (1000000007)
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
#define ggr getchar();getchar();return 0;
using namespace std;
double a,b,c,d,e,f;
signed main(){
    while(cin>>a>>b>>c>>d>>e>>f){
        double ans1=(c*e-b*f)/(a*e-b*d),ans2=(c*d-a*f)/(b*d-a*e);
        if(c*e==b*f)ans1=0;
        if(c*d==a*f)ans2=0;
        if((int)(ans1*10000)%10>=5)ans1=(int)(ans1*1000)+1;
        else ans1=(int)(ans1*1000);
        if((int)(ans2*10000)%10>=5)ans2=(int)(ans2*1000)+1;
        else ans2=(int)(ans2*1000);
        printf("%.3lf %.3lf\n",ans1/1000,ans2/1000);
    }
    ggr;
}

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

using namespace std;

int main(int argc, char* argv[])
{
	double a, b, c, d, e, f;
	double b1, c1, e1, f1;
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f) {
		b1 = b * d;
		c1 = c * d;
		e1 = e * a;
		f1 = f * a;

		if (b1 == e1) continue;
		y = (c1 - f1) / (b1 - e1);
		x = (c - b * y) / a;
		printf("%.3f %.3f\n", x, y);
	}
	
	return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){

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

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

int main(void){
	double a,b,c,d,e,f;
	double x,y;
	cout << fixed;
	cout.precision(3);
	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);
		if(x==0) x=0.0;
		if(y==0) y=0;
		cout << x << " " << y << endl;
	}
	return 0;
}

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

int main(){

    double a,b,c,d,e,f,y,x,bb,cc,dd,ee,ff;
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
        bb=b/a;
        cc=c/a;
        ee=e/d;
        ff=f/d;
        y=(cc-ff)/(bb-ee);
        x=(c-b*y)/a;
        //y=123.45678;
        y=round(1000*y);
        y=(int)y;
        y=y/1000+0.0;
        
        x=round(1000*x);
        x=(int)x;
        x=x/1000+0.0;
        cout<<fixed<<setprecision( 3 )<<x<<" "<<y<<endl;
        //printf("%f %f\n",x,y);
    }
    return 0;
}

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

int main(){
  double a, b, c, d, e, f;
  cout << fixed;
  cout << setprecision(3);

  while(cin >> a >> b >> c >> d >> e >> f){
    if(c*e == b*f)
      cout << 0.000 << " ";
    else
      cout << (c*e -b*f)/(a*e - b*d) << " ";
    if(c*d == a*f)
      cout << 0.000 << " ";
    else
      cout << (c*d - a*f)/(b*d - a*e) << endl;
  }

  cout << d << " " << e << endl;
  return 0;
}

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

double ans(double a,double b,double c,double d,double e,double f){
    double y1=b*d;
    double a1=c*d;
    double y2=e*a;
    double a2=f*a;
    double y=y1-y2;
    double a3=a1-a2;
    return a3/y;
}

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

    cout<<fixed<<setprecision(3)<<ans(b,a,c,e,d,f)<<' '<<setprecision(3)<<ans(a,b,c,d,e,f)<<endl;
}

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

double det(double a, double b, double c, double d){
	return a*d - b*c ;
}

int main() {
	// your code goes here
	
	double a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		x=det(c,b,f,e)/det(a,b,d,e);
		y=det(a,c,d,f)/det(a,b,d,e);

		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>   
using namespace std;
 
int main(){
	double a,b,c,d,e,f,aa,bb,cc,i = 0,x,y;
	while(cin >> a >> b >> c >> d >> e >> f){
	aa = a;
	bb = b;
	cc = c;
	a = a * d;
	b = b * d;
	c = c * d;

	d = d * aa;
	e = e * aa;
	f = f * aa;

	y = (c - f) / (b - e);
	x = cc - (bb * y);
	x = x / aa;
    cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
	}
}

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

using namespace std;

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

double x(double, double, double, double, double, double) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double, double, double, double, double, double) {

	return (a*f - c*d) / (a*e - b*d);
}

double round(double dat, int keta){
	int fct;

	fct = (int)pow(10, keta - 1);
	dat *= fct;
	dat += (dat < 0) ? -0.5 : 0.5;
	dat = (int)(dat);
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2;
	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

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

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);

	cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl;
	cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl;

	return 0;
}

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

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

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

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

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

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

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

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

		cout<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}

	return 0;
}