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

C++: #include<iostream>
#include<stdio.h>
using namespace std;
double dat(double a,double b,double c,double d) {
	return a*d - b*c;
}
int main() {
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f) {
		// クラメルの公式を利用
		double A = dat(a,b,d,e);
		//if(A == 0)
		//	cout << "error" << endl;
		double A1 = dat(c,b,f,e);
		double A2 = dat(a,c,d,f);
		
		// x y
		double x = A1/A;
		double y = A2/A;
		
		// 小数点第4位で四捨五入
		int x_cp;
		int y_cp;
		if(x < 0)
			x_cp = (int)(x*1000 - 0.5);
		else
			x_cp = (int)(x*1000 + 0.5);
		if(y < 0)
			y_cp = (int)(y*1000 - 0.5);
		else
			y_cp = (int)(y*1000 + 0.5);
		
		x = (double)x_cp / 1000;
		y = (double)y_cp / 1000;
		
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

int main(){
    float a, b, c, d, e, f, x, y, dividedNum1, dividedNum2 = 0;
    while(cin >> a >> b >> c >> d >> e >> f){
        dividedNum1 = a;
        dividedNum2 = d;
        a /= dividedNum1;
        b /=dividedNum1;
        c /= dividedNum1;
        d /= dividedNum2;
        e /= dividedNum2;
        f /= dividedNum2;
        
        float temp1 = b - e;
        float temp2 = c - f;
        
        y = floor((temp2 / temp1) * 1000 + 0.0005) / 1000;
        x = floor((c - (b * y) ) * 1000 + 0.0005) / 1000;
        
        cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  double x, y;
  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", floor(x * 1000.0) / 1000.0, floor(y * 1000.0) / 1000.0);
  return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    double det = a*e - b*d;
    double x = (e*c-b*f)/det;
    double y = (-d*c+a*f)/det;

    cout.setf(ios::showpoint);
    cout.precision(4);
    cout << x << ' ' << y << endl;

  }
  return 0;
}

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

using namespace std;

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

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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include<algorithm>
#define pf printf
#define sf scanf
#define wh while
#define db double
#define LL long long
#define _USE_MATH_DEFINES
#define re(i,a,b) for(int i=a;i<b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

int main()
{
    db a,b,c,d,e,f,x,y;
    wh(sf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)==6){
        if((e*c-b*f)==0)x=0;
        else x=(e*c-b*f)/(a*e-b*d);
        y=(c-a*x)/b;
        pf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ????????§ ax+by=c, dx+ey=f ????§£?????????????????¨???????????¨???????¨????????????????(1)
    vector<vector<double>> answers;
    double a, b, c, d, e, f;
    int dump;
    while(cin >> a >> b >> c >> d >> e >> f) {
        double det = (double)(a*e-b*d);
        double ansx = (e*c+(-b)*f)/det;
        double ansy = ((-d)*c+a*f)/det;
        answers.push_back({ansx,ansy});
    }
    for(auto elm : answers) {
        cout << fixed << setprecision(3) << elm[0] << " " << elm[1] << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
    int a[3];
    int b[3];
    int y[3];
    int x[3];
    while(true) {
    REP(i,3)
        cin >> a[i];
    REP(i,3)
        cin >> b[i];
    if(!cin)
        return 0;
    double o[2];
        o[0] = b[1]*a[2] - a[1]*b[2];
        o[1] = -b[0]*a[2] + a[0]*b[2];
    REP(i,2)
        o[i] = (o[i]==0)?0:o[i]/(a[0]*b[1]-b[0]*a[1]);
    cout << fixed << setprecision(3) << o[0] << ' ';
    cout << fixed << setprecision(3) << o[1] << '\n';
    }
}

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

int main(){
	int a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		b=d*b-a*e;
		c=d*c-a*f;
		y=(double)c/b;
		x=(f-e*y)/d;
		cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004
#include <bits/stdc++.h>
using namespace std;

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

    cout<<fixed; // ?°???°?????\??????????????????????????????????????????????????°???????????°??????????????????
    cout<<setprecision(3)<<x<<" "<<y<<endl;
  }
  return EXIT_SUCCESS;
}

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 + 0.0 << " " << y + 0.0 << endl;
  }

  return 0;
}

C++: #include <stdio.h>
main(){
 double x,y,a,b,c,d,e,f;
  while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) !=EOF){
    if(a!=0&&a*e!=0&&c/a-(b*f)/(a*e)!=0&&1-b*d/(a*e)!=0){
      x=(c/a-(b*f)/(a*e))/(1-b*d/(a*e));
      y=(f-d*x)/e;
    }
    else if(a==0){
      y=c/b;
      x=(f-e*y)/d;
    }
    else if(e==0){
      x=f/d;
      y=(c-a*x)/b;
    }
    else{    
      x=(f/d-(e*c)/(b*d))/(1-a*e/(b*d));
      y=(f-d*x)/e;
    }

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

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

int main(void){
    double a, b, c, d, e, f;
    
    cin >> a >> b >> c >> d >> e >> f;
    
    b = b / a;
    c = c / a;
    a = a / a;          //a = 1
    
    e = e - d*b;
    f = f - d*c;
    d = d - d*a;        //d = 0
    
    f = f / e;
    e = e / e;          //e = 1
    
    c = c - b*f;
    b = b - b*e;
    
    printf("%.3f %.3f",c , f);
}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	float x,y,goukei,g,g1,a,b,c,d,e,f,a1,b1,c1,d1,e1,f1;
	while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		g=a*d;
			a1=d*a;
			b1=d*b;
			c1=d*c;
			e1=a*e;
			d1=a*d;
			f1=a*f;
			y=b1-e1;
			goukei=c1-f1;
			y/=goukei;
			x=(c-b*y)/a;	
		printf("%.3f %.3f",x,y);
	}
	return 0;
}

C++: #include <stdio.h>

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