Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

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

using namespace std;

//substitution
int main() {

int a,b,c,d,e,f,x,y;

	while(1) {
		cin >> a >> b >> c >> d >> e >> f;
		if ( cin.eof() ) {
			break;
		}
	//a*x + b*y = c  and d*x + e*y = f
	
	 float y =(a*f - c*d)/(a*e - b*d);
	 float x =(c*e - b*f)/(a*e - b*d);
	
	cout << x << " " << y << endl;
	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;
	
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x, y;
		y = (c - a*f/d)/(b - a*e/d);
		x = (c - b*y)/a;
		printf("%.3lf %.3lf\n", x, y);
	}
	
	return 0;
}

C++: #include <stdio.h>

using namespace std;


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

	while(scanf("%lld %lld %lld %lld %lld %lld",&a,&b,&c,&d,&e,&f)!=EOF){
		if(c*e==b*f){
			x=0;
		}else{
			pre_x=(10000*(c*e-b*f))/(a*e-d*b);
			if((pre_x%10) >= 5){
				pre_x += (10-(pre_x%10));
			}
			x = pre_x/10000;
		}

		if(a*f==c*d){
			y=0;
		}else{
			pre_y=(10000*(a*f-c*d))/(a*e-b*d);
			if((pre_y%10) >= 5){
				pre_y += 10 - (pre_y%10);
			}
			y = pre_y/10000;
		}

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

    return 0;
}

C++: #include<iostream>


using namespace std;

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

		x=(e*c-f*b)/(e*a-b*d);
		y=(d*c-f*a)/(b*d-a*e);
		printf("%.3f %.3f\n",x,y);

	}
}

C++: #include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <unordered_map>
#define Debug 0
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

//最大公約数
template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//最小公倍数
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

vector<pair<double, double>> vans;
void solve(double *a, double *b) {
    double a2[3];
    double b2[3];
    a2[0] = a[0] * b[1];
    a2[2] = a[2] * b[1];
    b2[0] = b[0] * a[1];
    b2[2] = b[2] * a[1];
    double ans[2];
    if (a[1] && b[1]) {
        ans[0] = (a2[2]-b2[2])/(a2[0]-b2[0]); 
        ans[1] = ((a[2] - ans[0]*a[0]) / a[1]);
    } else {
        if (!a[1]) {
            ans[0] = a[2] / a[0];
            ans[1] = (b[2] - ans[0]*b[0]) / b[1];
        } else {
            ans[0] = b[2] / b[0];
            ans[1] = (a[2] - ans[0]*a[0]) / a[1];
        }
    }
    if (ans[0] == -0) ans[0] = 0;
    if (ans[1] == -0) ans[1] = 0;
    vans.push_back({ans[0], ans[1]});
}

int main(){
    double a[3], b[3];
    while (cin >> a[0]) {
        cin >> a[1];
        cin >> a[2];
        cin >> b[0];
        cin >> b[1];
        cin >> b[2];
        solve(a, b);
    }
    for (auto i: vans) {
        printf("%.3f %.3f\n", i.first, i.second);
    }
}

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



int main()
{
	double a[3], b[3];
	while (cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2])
	{
		if (a[0] == 0)
		{
			double c = a[2] / a[1];
			double d = (b[2] - b[1] * c) / b[1];
			a[2] = d;
			b[2] = d;
		}
		else
		{
			double c = 1;
			if (b[0] != 0)
			{
				c = a[0] / b[0];
				b[1] = b[1] * c - a[1];
				b[2] = b[2] * c - a[2];
			}
			b[2] /= b[1];
			b[1] = 1;
			a[2] -= b[2] * a[1];
			a[2] /= a[0];
		}
		if (a[2] < 0.0001 && a[2] > -0.0001)
			a[2] = 0.000;
		if (b[2] < 0.0001 && b[2] > -0.0001)
			b[2] = 0.000;

		cout << fixed << setprecision(3) << a[2] << b[2] << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstdio>
#define EPS 10e-6
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;
typedef long long ll;
int a, b, c, d, e, f;

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

C++: #include <cstdio>

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

    return 0;
}

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

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(3);

	constexpr double EPS = 1e-7;

	for(double a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f;) {
		double x, y;
		if(abs(e) < EPS) {
			x = (f - c * e / b) / (d - a * e / b);
			y = (c - a * x) / b;
		}
		else {
			x = (c - f * b / e) / (a - d * b / e);
			y = (f - d * x) / e;
		}

		cout << x << " " << y << endl;
	}

	return EXIT_SUCCESS;
}

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

int main()
{
    double a,b,c,d,e,f;
    double x,y;
    
    while(cin >> a >> b >> c >> d >> e >> f){
     if(b*d - a*e != 0)
         
         double tmp1 = (c*e - b*f),tmp2 = (a*e - b*d),tmp3 = (c*d - a*f),tmp4=(b*d - a*e);
        tmp1 = tmp1/tmp2;
        tmp2 = tmp3/tmp4;
        x = tmp1;
        y = tmp2;
         printf("%.3f %.3f",x,y);
    }
    return 0;
}

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

using namespace std;

int main(){
    double 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.precision(3);
        cout.setf(ios::fixed);
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

C++: /* All men have limits. They learn what they are and learn
   not to exceed them, I ignore mine. -Batman           */
#include <bits/stdc++.h>
//#include <iostream>
//#include <vector>
//#include <Windows.h>
using namespace std;

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

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

int main()
{
        using namespace std;
        double a,b,c,d,e,f;

        while(cin >> a >> b >> c >> d >> e >> f){
                printf("%.3f %.3f",(c*e-b*f)/(a*e-d*b),(a*f-d*c)/(a*e-d*b));
        }

        return 0;
}

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

int main()
{
	float a[6],b[6]={0,0,0,0,0,0},c=0;

	while(1){
		for(int i=0;i<6;i++)
			cin>>a[i];

		printf("%.4f %.4f",(a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]),(a[0]*a[5]-a[2]*a[3])/(a[0]*a[4]-a[1]*a[3]));
		for(int i=0;i<6;i++){
			if(a[i]==b[i]){
				c++;
				if(c==6)
					return 0;
			}
			for(int j=0;j<6;j++)
				a[i]=b[i];
		}
	}
}