Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

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

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

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

#include <math.h>
using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		if(X==0){X=0;};
		if(Y==0){Y=0;};

		printf("%.3f %.3f\n",X,Y);
	}

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
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 = (a * f - c * d) / (a * e - b * d);
    printf("%.3f %.3f\n", x, y);

  }
}

C++: // 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		int num_x = c * e - b * f, den_x = a * e - b * d;
		int num_y = c * d - a * f, den_y = b * d - a * e;
		long double X, Y;
		if(num_x == 0)X = 0.0;
		else X = num_x / (long double)den_x;
		if(num_y == 0)Y = 0.0;
		else Y = num_y / (long double)den_y;
		cout << fixed << setprecision(3);
		cout << X << ' ' << Y << '\n';
	}
	return 0;
}
// Write Here

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

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

	
	while (scanf( "%d%d%d%d%d%d" ,&a,&b,&c,&d,&e,&f) )
	
	{
		double y=(double)(c*d-a*f)/(double)(b*d-a*e);
		if(a!=0)
		
		printf("%.3f %.3f\n",(c-b*y)/a,y);
		else
		printf("%.3f %.3f\n",(f-e*y)/d,y);
	}

    return 0;
    
    }

C++: #include <iostream>

using namespace std;

int main()
{
	int a,b,c,d,e,f;
	float x,y,dx,dy;
	while( cin >> a >> b >>c >>d >> e >> f ) {
		x = (c*e-b*f)/(float)(a*e-b*d);
		y = (c - a*x)/(float)b;
		
		dx =x -  (x / 0.001)*0.001;
		if( dx >= 0.0005)
			x = (x / 0.001)*0.001 + 0.001;
		else
			x = (x / 0.001)*0.001;

		dy =y -  (y / 0.001)*0.001;
		if( dy >= 0.0005)
			y = (y / 0.001)*0.001 + 0.001;
		else
			y = (y / 0.001)*0.001;
	
		printf("%.3f %.3f\n",x,y);
	}



	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  double a,b,c,d,e,f;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    double x=(c*e-b*f)/(a*e-b*d);
    double y=(a*f-c*d)/(a*e-b*d);
    if(x==0)x=0;
    if(y==0)y=0;
    printf("%.3f %.3f\n",x,y);
  }
}

    
    /*
      ey=f-dx
      y=(f-dx)/e
      ax+b(f-dx)/e=c
      aex+df-bdx=ce
      (ae-bd)x=ce-df
      x=(ce-df)/(ae-bd)

  y=(f-dx)/e
  y=(f



a b  x  c
d e  y  f

x  c  e -b
y  f  -d a  /(ae-bd)*/

C++: #include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
using namespace std;
class SimultaneousEquation{ 
    public:
        void solve(int a,int b,int c,int d,int e,int f){ 
            double x,y;
            x=double(a*e-b*d)/(c*e-b*f);
            y=double(c*d-a*f)/(b*d-a*e);
            printf("%.3lf %.3lf\n",x,y);
            }
};
int main(){ 
    int a,b,c,d,e,f;
    SimultaneousEquation inst;
    while(cin>>a>>b>>c>>d>>e>>f){
        inst.solve(a,b,c,d,e,f);
    }
}

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

void OutputSolution(int a, int b, int c, int d, int e, int f)
{
    double x, y;
	if(a == 0){
		y = c / b;
		x = (f-e*y) / d;
	}else{
		int A = a;
		a *= d;
		b *= d;
		c *= d;
		d *= A;
		e *= A;
		f *= A;
		y = (c-f) / (b-e);
		x = (c-b*y) / a;
	}
	cout << fixed << setprecision(3) << x << ' ' << y << endl;
}

int main()
{
	while(true){
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;
		OutputSolution(a, b, c, d, e, f);
	}
	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)
    {
        y=(a*f-c*d)/(a*e-d*b);
        x=(c-b*y)/a;
        printf("%.3f %.3f\n",x,y);
    }
}

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

#define REP(i, a) for(int i=0;i<(int)a;++i)
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){
        double x=(c*e-b*f)/(a*e-b*d);
        double y=(c-a*x)/b;

        if(abs(x)<1e-10){
            x=0;
        }
        if(abs(y)<1e-10){
            y=0;
        }
        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 ,ans1 , ans2;
	while(cin>>a>>b>>c>>d>>e>>f){
		ans1=(c*e-b*f)/(a*e-b*d);
		ans2=(c*d-a*f)/(b*d-a*e);
		printf("%.3f %.3f\n" , ans1 , ans2);
	}
	return 0;
}

C++: 
/* vo00_04.cpp */
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;

int is_double(double dl);
double m_round(double d);

int main()
{
	double x1, y1, a1;
	double x2, y2, a2;
	double x, y;
	bool f_x, f_y;

	while (true) {
		cin >> x1 >> y1 >> a1 >> x2 >> y2 >> a2;
		if (cin.eof()) break;
		


		f_x = false; f_y = false;

		int p = max({ is_double(x1), is_double(x2), is_double(y1), is_double(y2) });
		if (p) { p *= 10; x1 *= p; x2 *= p; y1 *= p; y2 *= p; }

		if (x1 && x2) {
			int temp = x1;
			x1 *= x2; y1 *= x2; a1 *= x2;
			x2 *= temp; y2 *= temp; a2 *= temp;

			double y3 = y2 - y1, a3 = a2 - a1;

			y = a3 / y3;
			f_y = true;
		}

		if (y1 && y2) {
			int temp = y1;
			x1 *= y2; y1 *= y2; a1 *= y2;
			x2 *= temp; y2 *= temp; a2 *= temp;

			double x3 = x2 - x1, a3 = a2 - a1;

			x = a3 / x3;

			f_x = true;
		}

		if (!f_x || !f_y) {
			// どちらかに0があれば
			if (!x1) { y = a1 / y1; f_y = true; }
			else if (!x2) { y = a2 / y2; f_y = true; }

			if (!y1) { x = a1 / x1; f_x = true; }
			else if (!y2) { x = a2 / x2; f_x = true; }

			if (f_x) {
				if (x1) { x1 *= x; a1 -= x1; y = a1 / y1; }
				else if (x2) { x2 *= x; a2 -= x2; y = a2 / y2; }

				f_y = true;
			}
			if (f_y) {
				if (y1) { y1 *= y; a1 -= y1; x = a1 / x1; }
				else if (y2) { y2 *= y; a2 -= y2; x = a2 / x2; }

				f_x = true;
			}
		}

		if (f_x && f_y) {
			x = m_round(x); y = m_round(y);
			printf("%.3lf %.3lf\n", x, y);
		}
	}

	return 0;
}

int is_double(double dl)
{
	dl = fabs(dl);
	int d = (int)dl;
	double temp = dl - (double)d;

	if (!temp) return 0;

	else {
		int i;
		for (i = 0; temp < 1; ++i) temp *= 10;

		return i;
	}
}

double m_round(double d)
{
	bool flag = false;
	if (d < 0) { flag = true; d = -d; }

	d *= 1000;
	d += 0.5;

	int t1 = (int)d;
	double t2 = d - (double)t1;
	d -= t2;

	d /= 1000;

	if (flag) { d = -d; }

	return d;
}