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 <bits/stdc++.h>
using namespace std;

long long a,b,c,d,e,f,kpk,tmp1,tmp2,kali1,kali2,x,y;
double ans1,ans2;


int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	while(cin>>a>>b>>c>>d>>e>>f){
		tmp1=b; tmp2=c;
		if(a==0 || d==0){
			kpk=1;
		}else
			kpk=a*d/__gcd(a,d);
		if(a==0){
			kali1=1;
		}else
			kali1=kpk/a;
		if(d==0){
			kali2=1;
		}else
			kali2=kpk/d;
		b*=kali1;
		c*=kali1;
		e*=kali2;
		f*=kali2;
		x=b-e;
		y=c-f;
		if(x==0){
			ans2==0;
		}else
			ans2=y*1.0/x;
		if(a==0){
			ans1==0;
		}else
			ans1=(tmp2-(tmp1*ans2))*1.0/a;
		cout<<fixed<<showpoint<<setprecision(3);
		cout<<ans1<<' '<<ans2<<'\n';
	}
	
	
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(){

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

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

double* solve_equations(int *a)
{
	// クラメルの公式を用いる
	int data_size=sizeof(a[0]);
	/*cout << "data_size=" << data_size << endl;
	cout << "a=" << a << endl;
	cout << "*(a + data_size*1)=" << *(a + 1) << endl;
	cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */
	int z = *(a + 0) * *(a + 4) 
		  - *(a + 1) * *(a + 3);
	int x = *(a + 2) * *(a + 4)
		  -	*(a + 1) * *(a + 5);
	int y = *(a + 0) * *(a + 5)
		  - *(a + 2) * *(a + 3);  
	double ax,ay;
	/*cout << "x=" << x << endl;
	cout << "y=" << y << endl;*/
	ax = pow(z,-1)*x;
	ay = pow(z,-1)*y;
	
	/* cout << ax << endl;
	cout << ay << endl; */
	double ans[2] = {ax,ay};
	return ans;
}

int main()
{
	int *p;
	int a[6] = {1,2,3,4,5,6};
	/*
	p = solve_equations(a);
	cout << *p << *(p + 1) << endl;*/

	int n[6];
	while (cin){
		for (int i=0;i<=5;i++)
		{
			if(!(cin >> n[i]))
				break;
		}
		double *ans;
		ans = solve_equations(n);
		cout << fixed << setprecision(3) << ans[0] << ' '<< ans[1] << endl;
	}
			// cout << l[0]  endl;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double x = (e * c - b * f) / (e * a - b * d);
        double y = (c - a * x) / b;
        cout << fixed << setprecision(3) << x << " " << y << "\n";
    }
}

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

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

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

		printf("%.3f %.3f", x, y);
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;



int main(){
    int a,b,c,d,e,f;
    vector<double> tmp(2);
    while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
        double x=(c*e-f*b)/(a*e-d*b);
        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<bits/stdc++.h>
using namespace std;

const double EPS=1e-8;
typedef vector<double>vec;
typedef vector<vec>mat;

/// Ax=b
vec gauss_jordan(const mat& A,const vec& b){
    int n=A.size();
    mat B(n,vec(n+1));

    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)B[i][j]=A[i][j];

    for(int i=0;i<n;i++)B[i][n]=b[i];

    for(int i=0;i<n;i++){
        int pivot=i;
        for(int j=i+1;j<n;j++){
            if(abs(B[j][i])<abs(B[pivot][i]))pivot=j;
        }
        swap(B[i],B[pivot]);
        //if(abs(B[i][i])<EPS)return vec();

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

    vec x(n);
    for(int i=0;i<n;i++)x[i]=B[i][n];
    return x;
}

int main(){
    mat A(2,vec(2));
    vec b(2);
    while(true){
        for(int i=0;i<2;i++){
            if(scanf("%lf%lf%lf",&A[i][0],&A[i][1],&b[i])==EOF)return 0;
        }

        vec x=gauss_jordan(A,b);
        printf("%.3lf %.3lf\n",x[0],x[1]);
    }
    return 0;
}

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

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

int main(){
	int a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		int d1[3]={a,b,c};
		int d2[3]={d,e,f};
		double anx=0,any=0;
		if((c*e-f*b)!=0 && (a*e-d*b)!=0){
			anx=(c*e-f*b)/(a*e-d*b);
		}
		if((c*d-f*a)!=0 && (b*d-e*a)!=0){
			any=(c*d-f*a)/(b*d-e*a);
		}
		printf("%.3f ",anx);
		printf("%.3f\n",any);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
  double a,b,c,d,e,f;
  while( cin >> a >> b >> c >> d >> e >> f ){
    double x = (c/b - f/e) / (a/b - d/e);
    double y = (c - a*x) / b;
    if(x == -0) x = 0;
    if(y == -0) y = 0;
    cout << showpoint << x << " " << y << endl;
  }
}

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

int main() {
  double a,b,c,d,e,f,ad,bd,ae,cd,af,x,y;
  while(cin>>a>>b>>c>>d>>e>>f){ 
    ad=a*d;
    bd=b*d;
    cd=c*d;
    ae=a*e;
    af=a*f;
    y=(cd-af)/(bd-ae);
    x=(c-b*((cd-af)/(bd-ae)))/a;
    cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl;
  }
  return 0;
}