Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	for {
		data := nextInts(6)
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return ((c * e) - (b * f)) / ((a * e) - (b * d))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return ((c * d) - (a * f)) / ((b * d) - (a * e))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		int a2 = a, b2 = b, c2 = c;
		int g = a, h = d;
		if (g > h) swap(g, h);
		while (g != 0) {
			int k = g;
			g = h%g;
			h = k;
		}
		h = (h*(a / h)*(d / h));
		b = b*(h / a);
		c = c*(h / a);
		e = e*(h / d);
		f = f*(h / d);
		long double ansx = ((long double)(f - c) / (e - b)), ansy;
		ansy = (c2 - ansx*b2) / a2;
		printf("%LF %LF", ansy, ansx);
		cout << endl;
	}
}

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

using namespace std;

int main(){
    int a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f) {
        y = (c*d - a*f)/(b*d - a*e);
        x = (c*e - f*b)/(a*e - b*d);
        cout<<x<<" "<<y<<endl;
    }
    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){
        double detA;
        detA = a * e - b * d;
        x = (c * e - f * b) / detA;
        y = (a * f - c * d) / detA;
        cout << fixed << setprecision(3) << x + 0.0001 << " " << setprecision(3) << y + 0.0001 << '\n';
    }
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  double a, b, c, d, e, f;
  while(cin >> a){
    cin >> b >> c >> d >> e >> f;
    double det = a * e - b * d;
    cout << setprecision(12);
    cout << (ll)((e * c - b * f) / det);
    cout << " ";
    cout << (ll)((- d * c + a * f) / det) << endl;
  }
	return 0;
}

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

int main()
{
  double a[10],b[10];
  for(int i=0;i<6;i++)
  {

	  cin>>a[i];
	  if((a[i]>1000)||(a[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  for(int i=0;i<6;i++)
  {

	  cin>>b[i];
	  if((b[i]>1000)||(b[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  cout<<fixed<<setprecision(4)<<(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3])<<" ";
  cout<<fixed<<setprecision(4)<<(a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4])<<" ";
  cout<<fixed<<setprecision(4)<<(b[2]*b[4]-b[1]*b[5])/(b[0]*b[4]-b[1]*b[3])<<" ";
  cout<<fixed<<setprecision(4)<<(b[2]*b[3]-b[0]*b[5])/(b[1]*b[3]-b[0]*b[4])<<" ";
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	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));
		y = (c-a*x)/b;
		printf("%.3lf %.3lf\n",x,y);

		
	}
	return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

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

C++: #include <iostream>
#include <iomanip>
#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);

		X= floor(X*1000+0.5)/1000;
		Y= floor(Y*1000+0.5)/1000;

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

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

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, const char * argv[])
{
    double a=0.0;
    double b=0.0;
    double c=0.0;
    double d=0.0;
    double e=0.0;
    double f=0.0;
    double x=0.0;
    double y=0.0;
    int end=0;
    
    while(scanf("%d",&end)!=EOF){
        a=end;
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        
        y = (d*c-a*f)/(d*b-a*e);
        x = (c-b*y)/a;
        
        printf("%.3lf",x);
        printf(" ");
        printf("%.3lf\n",y);
        
    }
    
}

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

int main(){
	double a, b, c, d, e, f;
	double x, y;
	double A, B, C;
	const double p = 0.00000001;

	while (cin >> a >> b >> c >> d >> e >> f){
		A = (a*e) - (b*d);
		B = (c*e) - (b*f);
		C = (a*f) - (c*d);

		x = B / A;
		y = C / A;
		
		if (abs(x) < p) x = 0;
		if (abs(y) < p) y = 0;

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

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

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

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

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

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

using namespace std;

int main (void) {
    int a, b, c, d, e, f;
    double x, y;
    while (1) {
        cin >> a;
        cin >> b;
        cin >> c;
        cin >> d;
        cin >> e;
        cin >> f;
        if (cin.eof()) break;
        x = (double)(c * e - b * f) / (double)(a * e - b * d);
        y = (double)(c * d - a * f) / (double)(b * d - a * e);
        cout << fixed << setprecision(3) << x << endl;
        cout << fixed << setprecision(3) << y << endl;
    }
    return 0;
}