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>

int main(void) {
  double a, b, c, d, e, f;
  while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
    double ee = e / b, dd = d / a;
    double ax = a * ee, cx = c * ee;
    printf("%.3f ", (cx - f) / (ax - d) == -0 ? 0 : (cx - f) / (ax - d));
    b *= dd, c *= dd;
    printf("%.3f\n", (c - f) / (b - e) == -0 ? 0 : (c - f) / (b - e));
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
int main(){

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

    scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);

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

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


      return 0;
    }

C++: #include<bits/stdc++.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=(c*d-a*f)/(b*d-a*e);

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

}

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

#define MAX 1000

int main(void){

	float a, b, c, d, e, f;
	float ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%f%f%f%f%f%f%f", &a,&b,&c,&d,&e,&f) != EOF){
		if (a*e != b*d){
			ansx[i] = (c*e - b*f) / (a*e - b*d);
			ansy[i] = (c*d - a*f) / (b*d - a*e);
			if ((int)(ansx[i] * 10000) % 10 > 4){
				ansx[i] += 0.001;
			}
			if ((int)(ansy[i] * 10000) % 10 > 4){
				ansy[i] += 0.001;
			}
		}
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3f %.3f\n", ansx[j], ansy[j]);
	}
	
	return 0;
}

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

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

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

double round_at(double n,int dig){
    return ((int)(round(n*pow(10,dig))))/pow(10,dig);
}

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

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

#define MAX 256

int main(void){

	float a, b, c, d, e, f;
	float ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%f%f%f%f%f%f", &a,&b,&c,&d,&e,&f) != EOF){
		if (a*e != b*d){
			ansx[i] = (c*e - b*f) / (a*e - b*d);
			ansy[i] = (c*d - a*f) / (b*d - a*e);
			/*if (((int)(ansx[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansx[i] += 0.001;
			}
			if (((int)(ansy[i] * 10000) % 10) > 4 || ((int)(ansy[i] * 10000) % 10) < -4){
				ansy[i] += 0.001;
			}*/
		}
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3f %.3f\n", ansx[j], ansy[j]);
	}
	
	return 0;
}

C++: using namespace std;

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

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

int main()
{
	std::vector<int> x, y;
	int a, b, c, d, p, q;
	while (scanf_s("%d %d %d %d %d %d", &a, &b, &p, &c, &d, &q) != EOF)
	{
		x.push_back(d*p - b*q / (a*d - b*c));
		y.push_back(p*c - a*q / (b*c - a*d));
	}

	for (int i = 0; i < x.size(); ++i)
		std::cout << x[i] << " " << y[i] << std::endl;
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <iomanip>

using namespace std;

void inputData(vector<string>& data_set) {
	string buffer;
	while(getline(std::cin,buffer))
		data_set.push_back(buffer);
}

vector<string> splitString(const string& str, const string& separator = " ") {
	vector<string> ret;

	std::size_t bp, ep;
	bp = ep = 0;
	while((ep = str.find_first_of(separator, bp)) != string::npos){
		if(bp != ep){
			ret.push_back(string(str.begin() + bp, str.begin() + ep));
		}
		bp = ep + 1;
	}

	if(bp <= str.size() - 1){
		ret.push_back(string(str.begin() + bp, str.end()));
	}

	return ret;
}

template <class T>
T convertStringToNumber(const string& str) {
	stringstream ss;
	T ret;

	ss << str;
	ss >> ret;

	return ret;
}



vector<int> parseStringData(const string& data_str) {
	auto buff = splitString(data_str);

	vector<int> ret(buff.size());
	for(int i = 0; i < buff.size(); ++i){
		auto temp = convertStringToNumber<int>(buff[i]);
		ret[i] = temp;
	}

	return ret;
}


void displayAnswer(const vector<int>& data_set) {
	double det = 1.0 / (data_set[0] * data_set[4] - data_set[1] * data_set[3]); 
	double x = det * (data_set[4] * data_set[2] + -data_set[1] * data_set[5]);
	double y = det * (-data_set[3] * data_set[2] + data_set[0] * data_set[5]);

	cout << fixed << setprecision(3) << x << " " << y << std::endl;
}


void doAllProcess() {
	vector<string> buffer;
	inputData(buffer);

	for(int i = 0; i < buffer.size(); ++i){
		auto data_set = parseStringData(buffer[i]);
		displayAnswer(data_set);
	}
}


int main() {
	doAllProcess();

	return 0;
}

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

C++: #include <iostream>
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)1.0/(a*e-b*d)*(e*c-b*f);
		y=(double)1.0/(a*e-b*d)*(-d*c+a*f);
		cout << x << y << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

const double EPS = 1e-8;
typedef vector<double> Vec;
typedef vector<Vec> Mat;

void show(const Mat &m)
{
	puts("====");
	for (int i = 0; i < m.size(); i++){
		for (int j = 0; j < m[i].size(); j++){
			printf("%f ", m[i][j]);
		}
		puts("");
	}
	puts("====");
}

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];
		}
		B[i][n] = b[i];
	}
	
	for (int i = 0; i < n; i++){
		int pivot = i;
		for (int j = i; 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){
				for (int k = i + 1; k <= n; k++){
					B[j][k] -= B[j][i] * B[i][k];
				}
			}
		}
		
		//show(B);
	}
	
	Vec x(n);
	for (int i = 0; i < n; i++){
		x[i] = B[i][n];
	}
	
	return x;
}

int main()
{
	while (true){
		Mat A(2, Vec(2));
		Vec b(2);
		
		for (int i = 0; i < 2; i++){
			for (int j = 0; j < 2; j++){
				scanf("%lf", &A[i][j]);
			}
			scanf("%lf", &b[i]);
		}
		
		Vec res = gauss_jordan(A, b);
		printf("%f %f\n", res[0], res[1]);
	}
	
	return 0;
}

C++: #include<bits/stdc++.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=round((c*e-b*f)/(a*e-b*d)*1000)/1000;
    y=round((c*d-a*f)/(b*d-a*e)*1000)/1000;

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

}