Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a, b, c, d, e, f float64
		i, _ := fmt.Scan(&a, &b, &c, &d, &e, &f)
		if i == 0 {
			break
		}

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

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

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

using namespace std;

int main(void){
	double arr[6];
	vector<double> x,y;

	while (cin >> arr[0] >> arr[1] >> arr[2] >> arr[3] >> arr[4] >> arr[5]){
		double a = arr[0]; double b = arr[1]; double c = arr[2]; double d = arr[3]; double e = arr[4]; double f = arr[5];
		x.push_back((c*e-b*f)/(a*e-b*d));
		y.push_back((c*d-a*f)/(b*d-a*e));
	}
	for (unsigned int i=0; i<x.size(); ++i){
		cout << x[i] << " " << y[i] << endl;
	}
	return 0;
}

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

int det(int a00, int a01, int a10, int a11)
{
	return a00*a11 - a01*a10;
}

int main()
{
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		int t = det(a, b, d, e);
		printf("%.3f %.3f", (double)det(c, b, f, e) / t, (double)det(a, c, d, f) / t);
	}
	return 0;
}

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

using namespace std;

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

C++: #include "iostream"
using namespace std;

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

    while(cin >> a >> b >> c >> d >> e >> f) {
        double num1 = a,num2 = d, x, y;
        a *= num2; b *= num2; c *= num2;
        d *= num1; e *= num1; f *= num1;

        num1 = b - e; num2 = c - f;
        y = num2 / num1; x = (c - b*y) / a;

        x *= 10000; y *= 10000;
        num = (int)x; x = (double)num;
        num = (int)y; y = (double)num;
        num1 = (int)x % 10; num2 = (int)y % 10;

        x /= 10000; y /= 10000;

        if (num1 > 4) {
            x += 0.001;
        }
        if (num2 > 4) {
            y += 0.001;
        }

        printf("%0.3f %0.3f\n", x, y);

    }
    
    return 0;
}

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

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

	while (1) {
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

		x = (f/e-c/b)/((-a/b)-(-d/e));
		y = (-a/b)*x+c/b;

		printf("%5.3lf %5.3lf\n", (double)(int)((x*1000.0+0.5))/1000.0, (double)(int)((y*1000+0.5)/1000));
		//cout<<setprecision(4)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}

	return 0;
}

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

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