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("%.3f %.3f\n", x, y)
        }
}

C++: #include <bits/stdc++.h>
// #include "bits/stdc++.h"

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
 
typedef long long ll;
using namespace std;
 
int main() {
  double a,b,c,d,e,f,x,y;

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

  return 0;
}

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

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

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
  int 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);
    printf("%.3f %.3f\n", x + 0.0001, y + 0.0001);
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
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 = (c*d - a*f) / (b*d - a*e);
		if( fabs(x) < 0.0005 ) x = 0.0;
		if( fabs(y) < 0.0005 ) y = 0.0;
		cout << fixed << std::setprecision(3) << x << " " << y << "\n";
	}
	return 0;
}

C++: #include <bits/stdc++.h>	//C++標準ライブラリ一括読み込み
using namespace std;

// ax+by=c
// dx+ey=f
double unko(double x){
	int y=int(round(x*1000));
	return double(y)/1000;
}

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

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

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

using namespace std;

int main()
{
    double a,b,c,d,e,f;
    while (cin>>a>>b>>c>>d>>e>>f) {
        double x = (c * e - f * b) / (a * e - d * b);
        double y = (c * d - f * a) / (b * d - a * e);

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

C++: #include <iostream>

using namespace std;

int main(){
	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);

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

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)){
    // ax+by=c
    // dx+ey=f
    double x,y;
    x = (b*f-c*e)/(b*d-a*e);
    y = (c*d-a*f)/(b*d-a*e);
    if(abs(x)<1e-9) x = abs(x);
    if(abs(y)<1e-9) y = abs(y);
    // x = round(x*1000.0)/1000.0;
    // y = round(y*1000.0)/1000.0;
    printf("%.3lf %.3lf\n",x,y);
  }
  return 0;
}

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

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

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

	return 0;

}

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

int main(){
	double a,b,c,d,e,f,x,y;
	while(true){
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.eof()) break;
		x=(b*f-c*e)/(b*d-a*e);
		y=(c-a*x)/b;
		x=round(x*1000.0)/1000.0;
		y=round(y*1000.0)/1000.0;
		if(x-0.0<0.001&&x-0.0>-0.001) x=0.0;
		if(y-0.0<0.001&&y-0.0>-0.001) y=0.0;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: # include <algorithm>
# include <cassert>
# include <cctype>
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cmath>
# include <iostream>
# include <map>
# include <queue>
# include <set>
# include <sstream>
# include <stack>
# include <string>
# include <vector>
# include <iomanip>

# define rep(i, n) for (int i = 0; i < (int)(n); i++)
# define irep(i, n) for (int i = int(n) - 1; i >= 0; i--)
# define FOR(i, m, n) for (int i = int(m); i < (int)(n); i++)

using namespace std;
typedef long long ll;


// %% begin matrix %%

typedef vector<double> vec;
typedef vector<vec> mat;

void pretty_print(mat g) {
  rep (i, g.size()) {
    rep (j, g[0].size()-1) {
      cout << g[i][j] << ' ';
    }
    cout << g[i][g[0].size()-1] << endl;
  }
}


mat mul(mat A, mat B) {
  mat C(A.size(), vec(B.size()));
  rep (i, A.size()) {
    rep (k, B.size()) {
      rep (j, B[0].size()) {
        C[i][j] += A[i][k] * B[k][j];
      }
    }
  }
  return C;
}

// %% end matrix %%


vec jordan(mat &A, vec &b) {
  int n = A.size();

  // ?????§?????°??????
  mat B(n, vec(n+1));
  rep (i, n) {
    rep (j, n) {
      B[i][j] = A[i][j];
    }
    B[i][n] = b[i];
  }


  rep (i, n) {
    int pivot = i;

    // ?????????
    for (int j = i; j < n; j++) {
      if (abs(B[j][i]) > abs(B[pivot][i])) {
        pivot = j;
      }
    }
    swap(B[i], B[pivot]);

    if (abs(B[i][i]) < 0.0000001) {
      return vec();
    }

    for (int j = i+1; j <= n; j++) B[i][j] /= B[i][i];
    rep (j, n) {
      if (i != j) {
        for (int k = i+1; k <= n; k++) {
          B[j][k] -= B[j][i] * B[i][k];
        }
      }
    }
  }

  vec x(n);
  rep (i, n) {
    x[i] = B[i][n];
  }

  return x;
}




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

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

    mat A = {
      {a, b},
      {d, e}
    };

    vec B = {
      c, f
    };

    vec x = jordan(A, B);
    cout << x[0] << " " << x[1] << endl;
  } 
}

C++: #include <stdio.h>
double round3(double 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/1000;

	return a;

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